\r\n```\r\n\r\nAlternatively, use the `desc` defined in the `container` to write Markdown syntax.\r\n\r\n```md\r\n::: demo src=\"../demo.vue\" title=\"Demo block\"\r\n\r\nThis is a `description` that can be written using Markdown.\r\n\r\n:::\r\n```\r\n\r\n### Describe the solution you'd like\r\n\r\nTo address this, I have created the [markdown-it-vitepress-demo](https://github.com/hairyf/markdown-it-vitepress-demo) plugin. I'm not sure if it can be helpful.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n- https://github.com/vuejs/vitepress/issues/987\r\n- https://github.com/vuejs/vitepress/issues/1349\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2867],{"name":2868,"color":2869},"stale","ededed",2432,"vuejs","vitepress","open","feat(demo): built-in markdown plugin provides support for showcasing demo capabilities.","2024-07-17T14:37:26Z","https://github.com/vuejs/vitepress/issues/2432",0.6783497,{"description":2879,"labels":2880,"number":2884,"owner":2871,"repository":2872,"state":2885,"title":2886,"updated_at":2887,"url":2888,"score":2889},"I am looking into porting the using vue in Markdown from vuepress: \r\nhttps://vuepress.vuejs.org/guide/using-vue.html\r\n\r\nIf I understand correctly, vitepress doesn't want to auto register components by convention as Vuepress does. Is this the case? I actually liked this feature, but I understand that vitepress wants to keep the moving parts as small as possible.\r\n\r\nWhat is the recommended way to register the components? I see that in vue-router-next docs they are registered globally inside `enhanceApp`: https://github.com/vuejs/vue-router-next/search?q=HomeSponsors.\r\nSame as with this comment: https://github.com/vuejs/vitepress/issues/92#issuecomment-724645482\r\n\r\nShould we document this way in the docs?\r\n\r\nSome thoughts about this. It would be great that users that want to use the default theme as is, do not need to learn straight away about enhanceApp to be able to use a vue component in their markdown.\r\n\r\nIf auto registering by convention in a folder like `.vitepress/components` is not an option, could we import them directly in the markdown?\r\n\r\n```markdown\r\n# Docs\r\n\r\nThis is a .md using a custom component\r\n\r\n\u003CCustomComponent />\r\n\r\n## More docs\r\n\r\n...\r\n\r\n\u003Cscript setup>\r\n import CustomComponent from '../components/CustomComponent.vue'\r\n\u003C/script>\r\n```\r\n\r\nScript & style hoisting is working in vitepress: https://vuepress.vuejs.org/guide/using-vue.html#script-style-hoisting, but I tried this example to import a Component and it is not at this point.\r\n",[2881],{"name":2882,"color":2883},"docs","0075ca",157,"closed","Recommended way to use Custom Vue components in .md","2023-01-21T16:04:10Z","https://github.com/vuejs/vitepress/issues/157",0.67044467,{"description":2891,"labels":2892,"number":2893,"owner":2871,"repository":2872,"state":2885,"title":2894,"updated_at":2895,"url":2896,"score":2897},"I'm new to vue and vitepress so I'm a little confused.\r\n\r\nI'm looking into adding markdown to my existing vue app. The way I imagined it would be some markdown element which would take the markdown text and render it. I'm also interested in embedding vue components inside the markdown. Something like\r\n```\r\n\u003CMarkdown>\r\n## abc\r\nefg\r\n### hij\r\nHi {{name}},\r\n\u003C/Markdown>\r\n```\r\nI was hoping vitepress would do it, but it seems like vitepress sets everything up as a standalone app. I can't simply add vitepress to my package.json and start using it's elements.\r\n\r\nAny examples of using vitepress in an existing vue as a library? Or any alternative?",[],315,"Use vitepress in an existing vue app","2023-01-21T16:22:21Z","https://github.com/vuejs/vitepress/issues/315",0.67315894,{"description":2899,"labels":2900,"number":2904,"owner":2871,"repository":2872,"state":2885,"title":2905,"updated_at":2906,"url":2907,"score":2908},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nWhen I use the components directly in markdown file, It raised a waring with `vue.js:1099 [Vue warn]: Failed to resolve componen` as:\r\n\r\n\r\n\r\nDoes vitepress auto register components in `.vitepress/components`? or where can I put the `.vue` files and how to use them? thank you.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**System Info**\r\n- vitepress version:\r\n- vite version:\r\n- Node version:\r\n- OS version:\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n",[2901],{"name":2902,"color":2903},"bug: pending triage","e99695",60,"Is vitepress auto register components in `.vitepress/components`?","2023-01-21T16:25:31Z","https://github.com/vuejs/vitepress/issues/60",0.67379063,{"description":2910,"labels":2911,"number":2915,"owner":2871,"repository":2872,"state":2885,"title":2916,"updated_at":2917,"url":2918,"score":2919},"### Describe the bug\n\nVariable declared in the setup script using Vue3 composition API is not recognized by Vuetify 3 components\n\n### Reproduction\n\nI have the following in an `.md` file\r\n\r\n```\r\n\u003Cscript setup>\r\nimport {ref} from \"vue\"\r\n\r\nconst myArr = ref([10, 20, 30]);\r\nconst myTab = ref(0)\r\n\u003C/script>\r\n\r\nSome text here\r\n\r\nThe following works file\r\n\r\n\u003CMyCustomComponent v-for=\"x in myArr\">\r\n\u003C/MyCustomComponent>\r\n\r\nBut the following DOES not work\r\n\r\n\u003Cv-tabs v-model=\"myTab\">\r\n \u003Cv-tab>One\u003C/v-tab>\r\n \u003C/v-tab>Two\u003C/v-tab>\r\n\u003C/v-tabs>\r\n```\r\n\r\nThe error I saw in the browser console is:\r\n\r\n```\r\nruntime-core.esm-bundler.js:2779 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'value')\r\n at invokeDirectiveHook (runtime-core.esm-bundler.js:2779:47)\r\n at Array.\u003Canonymous> (runtime-core.esm-bundler.js:5349:25)\r\n at flushPostFlushCbs (runtime-core.esm-bundler.js:339:32)\r\n at flushJobs (runtime-core.esm-bundler.js:393:9)\r\n```\n\n### Expected behavior\n\nNo error expected\n\n### System Info\n\n```shell\nWorks on Firefox (Windows 11), but does not work on Chrome (Windows 11 and OSX)\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2912],{"name":2913,"color":2914},"need more info","bdbefc",1336,"Passing a ref() variable to Vuetify v-model","2023-01-21T14:25:21Z","https://github.com/vuejs/vitepress/issues/1336",0.68775266,{"description":2921,"labels":2922,"number":2924,"owner":2871,"repository":2872,"state":2885,"title":2925,"updated_at":2926,"url":2927,"score":2928},"### Describe the bug\n\nI want to use the vue component in vitepress. I have read the documentation on the official website, but when I do it, I encounter an error like this.\r\n```bash\r\n[plugin:vite:vue] Tags with side effect (\u003Cscript> and \u003Cstyle>) are ignored in client component templates.\r\n```\r\n\r\nI don't understand what I'm encountering, I just want to achieve the effect here in this vue document\r\n\r\n> https://cn.vuejs.org/guide/reusability/composables.html#vs-react-hooks\r\n\r\n\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-dn63jg?file=docs%2Fhooks%2FuseMouse.js,docs%2Fexample.md\n\n### Expected behavior\n\nThe documentation on the official website makes me understand the difficulty or the need for a better demo?\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 11 10.0.22631\r\n CPU: (20) x64 13th Gen Intel(R) CoreT i7-13800H\r\n Memory: 17.07 GB / 31.74 GB\r\n Binaries:\r\n Node: 20.11.0 - ~\\AppData\\Local\\pnpm\\node.EXE\r\n npm: 10.2.4 - ~\\AppData\\Local\\pnpm\\npm.CMD\r\n pnpm: 8.14.1 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (120.0.2210.133)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: 1.0.0-rc.39 => 1.0.0-rc.39\n```\n\n\n### Additional context\n\nPlease tell me the correct way to write it, thank you\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2923],{"name":2902,"color":2903},3485,"Using vue to report errors in markdown","2024-01-29T00:04:28Z","https://github.com/vuejs/vitepress/issues/3485",0.6879152,{"description":2930,"labels":2931,"number":2932,"owner":2871,"repository":2872,"state":2885,"title":2933,"updated_at":2934,"url":2935,"score":2936},"### Is your feature request related to a problem? Please describe.\r\n\r\nIn order to create good documentation of a standalone Vue component, we want to show many usage examples.\r\n\r\nEvery usage example is a Vue file.\r\n\r\nWe need to be able to import a Vue file in Vitepress, show its source code as CodeBlock.\r\n- Not just a single code block like you can already do in Vitepress, but a Codeblock with tabs on top that split up the source code in `template` / `script` / `style` tabs.\r\n- Also, another tab should say `example` rendering the actual imported Vue component.\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nThe ideal syntax would look something like this:\r\n```html\r\n\u003CCodeBlockComponent filename=\"blitz-form/Basics - Basic Example\" />\r\n```\r\nAnd here is a video of how it would render in Vitepress:\r\n\r\nhttps://user-images.githubusercontent.com/3253920/140631280-adae2d0b-47d9-4172-b105-f6f4ee5f41f4.mp4\r\n\r\n(I have styled this a little bit to fit my docs style, but of course the styling can be way more bare-bones and we can overwrite the styling with CSS.)\r\n\r\n\r\n\r\n### Describe alternatives you've considered\r\n\r\nI actually already finished this feature for VitePress. I created my custom solution.\r\n\r\nUnder the hood I'm using a combination of these import methods:\r\n```js\r\nimport(`../docs/${filename}.vue`) // for the component\r\n// and\r\nimport(`../docs/${filename}.vue?raw`) // for the source code\r\n```\r\n\r\n~~Everything works when I'm using the VitePress development server. However, as soon as I build and deploy my code to a hosting service, all the Code Blocks break.~~\r\n\r\n~~I searched a lot for solutions, but this is not my strongest point. This past week I tried a bunch of things but still haven't found out how to make it work.~~\r\n\r\n(See next comment, where I explain how I fixed it)\r\n\r\n### Additional context\r\n\r\nI would love to request for an official solution for what I'm trying to do.\r\n\r\nI believe a lot of developers who want to share a Vue component and whip up a quick VitePress documentation about their component, would love this feature.\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\r\n- [X] Read the [docs](https://vitepress.vuejs.org/).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/master/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],437,"FR: Code Block that renders Vue file component and source code","2023-01-29T00:04:23Z","https://github.com/vuejs/vitepress/issues/437",0.68851846,{"description":2938,"labels":2939,"number":1224,"owner":2871,"repository":2872,"state":2885,"title":2943,"updated_at":2944,"url":2945,"score":2946},"Hello!\r\n\r\nDocumentation says \"...allowing the user to freely mix Vue components inside markdown content...\" but it doesn't work as VuePress.\r\n\r\nTo reproduce init project according to documentation.\r\nCreate `.vitepress/components/NewComponent.vue` with a `\u003Ctemplate>\u003Cp>Hello VitePress\u003C/p>\u003C/template>`\r\nTry to use `\u003CNewComponent />` inside index.md\r\n\r\nExpected to see rendered component on the page see nothing.\r\nConsole says \"Failed to resolve component: NewComponent\"\r\n\r\nWhat I'm doing wrong? ",[2940],{"name":2941,"color":2942},"question","5D5FAE","Cant figure out how to use components inside .md file","2023-01-21T16:24:22Z","https://github.com/vuejs/vitepress/issues/101",0.6889297,{"description":2948,"labels":2949,"number":2950,"owner":2871,"repository":2872,"state":2885,"title":2951,"updated_at":2952,"url":2953,"score":2954},"### Is your feature request related to a problem? Please describe.\n\nI'm using VitePress to document our coding standards and our design system. I want to show examples of the code we would use (HTML and Vue components) *and* how that code would render.\r\n\r\nI can import and use Vue components in the markdown (and HTML) without issue. But to show both the \"live\" and \"source\" views of that code, I have to copy my live code into a separate markdown code block, which means now I have *two* blocks of code to manage and synchronize for each example.\n\n### Describe the solution you'd like\n\nI'd like a new directive for \"```\" code blocks that, when viewed in VitePress, shows up as a tabbed interface with two tabs: (1) the rendered version of that code (using the normal rendering done by VitePress, supporting Vue and HTML), and (2) the normal way the code block would be otherwise rendered.\r\n\r\nI *believe* this would simply require detecting this directive, duplicating the code within the block as non-fenced code, and wrapping the pair in a simple tabbed Vue component.\r\n\r\nObviously for more complex examples, the VitePress version of the live code will differ from what needs to be shown to the user, so that is a challenge (the Vue docs themselves have this challenge). But for simple examples of using Vue components and HTML with no additional script involved, it would really help.\r\n\r\nMy suggestion would be something like \"```html:live\", where the \":live\" bit either comes before or after any row number highlights (I don't think it would matter).\n\n### Describe alternatives you've considered\n\nCopying and pasting between markdown code blocks to markdown live code, keeping them synchronized as the code is updated.\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],554,"\"Live\" Code Blocks","2023-01-21T14:20:27Z","https://github.com/vuejs/vitepress/issues/554",0.6892473,{"description":2956,"labels":2957,"number":2959,"owner":2871,"repository":2872,"state":2885,"title":2960,"updated_at":2961,"url":2962,"score":2963},"### Describe the bug\n\nI referenced a globally registered component in the markdown document of vitepress. When I used it, the error was reported as follows:\r\n**[vitepress] Internal server error: At least one \u003Ctemplate> or \u003Cscript> is required in a single file component.**\r\n\r\n\r\n\n\n### Reproduction\n\nCreate vite.config.js in the vitepress root directory, the content is as follows:\r\n\r\n```\r\nimport { defineConfig } from \"vite\";\r\nimport vueJsx from \"@vitejs/plugin-vue-jsx\";\r\nimport vue from \"@vitejs/plugin-vue\"\r\nexport default defineConfig({\r\n plugins: [\r\n vue(),\r\n vueJsx(),\r\n ],\r\n});\r\n```\n\n### Expected behavior\n\nRender component content correctly\n\n### System Info\n\n```shell\nnode 16\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2958],{"name":2913,"color":2914},2095,"vitepress not support jsx file?","2023-03-29T00:04:14Z","https://github.com/vuejs/vitepress/issues/2095",0.692061,["Reactive",2965],{},["Set"],["ShallowReactive",2968],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f7nWeCyyzUFqoMf8ubpmPKy3xlrnsvYGY67q4xRjVDk0":-1},"/vuejs/vitepress/122"]