Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createContentLoader do not render Vue components in html output #3147

Open
4 tasks done
gonny opened this issue Oct 27, 2023 · 4 comments
Open
4 tasks done

createContentLoader do not render Vue components in html output #3147

gonny opened this issue Oct 27, 2023 · 4 comments
Labels
docs Improvements or additions to documentation stale wont fix

Comments

@gonny
Copy link

gonny commented Oct 27, 2023

Describe the bug

I have few *.md pages where I use custom globally registered Vue component to display formatted output. Display of such page using URL is as expected. But when I create createContentLoader and enable render: true option then I get HTML code without rendered Vue component, as a custom tag.

Reproduction

I prepared stackblitz code reproducing this issue. Link single card works as expected. card list loads data dynamically and displays the received html content.

https://stackblitz.com/edit/vite-8wtjts

Expected behavior

The render: true in createContentLoader should return also rendered Vue component instead of inline tag.

System Info

System:
    OS: macOS 11.7.10
    CPU: (4) x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
    Memory: 87.34 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.13.0 - /usr/local/bin/node
    npm: 9.8.1 - /usr/local/bin/npm
    pnpm: 8.9.1 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 118.0.5993.117
    Safari: 16.6.1
  npmPackages:
    vitepress: 1.0.0-rc.24 => 1.0.0-rc.24

Additional context

No response

Validations

@gonny gonny added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 27, 2023
@brc-dd brc-dd added wont fix and removed bug: pending triage Maybe a bug, waiting for confirmation labels Oct 28, 2023
@brc-dd
Copy link
Member

brc-dd commented Oct 28, 2023

It might not be expected behavior for you, but that function is only meant to convert markdown to vue-html. Any vue syntax inside that markdown file won't be touched.

@brc-dd brc-dd added the docs Improvements or additions to documentation label Oct 28, 2023
@gonny
Copy link
Author

gonny commented Oct 28, 2023

Ok, thanks.
Is there any way how to render also the Vue component? I tried to include Vue render function but warning said that it is not intended to directly render from SFC string (or something like that).

@dpi
Copy link

dpi commented Nov 27, 2023

I’d also appreciate some guidance / best practices here.

@github-actions github-actions bot added the stale label Jan 18, 2024
@SwatDoge
Copy link

Not having this feature makes contentLoaders basically pointless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation stale wont fix
Projects
None yet
Development

No branches or pull requests

4 participants