\n```\n\ndocs/AComponent.vue\n\n```vue\n\u003Ctemplate>\n \u003Ch2 id=\"bar\">bar\u003C/h2>\n \u003Ch2 id=\"baz\">baz\u003C/h2>\n\u003C/template>\n```\n\nResult: `## bar` and `## baz` appear in the outline and are linkable, but they have no header‑anchor element, so users cannot easily copy a permalink, and the UI feels a bit inconsistent when hovering the mouse over headings added by the component and the ones written in Markdown.\n\n\n### Describe the solution you'd like\n\nDuring the same client‑side pass that builds the outline, scan for any `\u003Ch1‑h6>` with an `id` but lacking `.header-anchor`, and inject an anchor with the same markup VitePress generates for Markdown headings.\n\n\n### Describe alternatives you've considered\n\nManually adding the anchor works...\n\n```html\n\u003Ch2 id=\"qux\">\n qux\n \u003Ca class=\"header-anchor\" href=\"#qux\" aria-label='Permalink to \"qux {#qux}\"'>​\u003C/a>\n\u003C/h2>\n```\n\n...but is somewhat boilerplate and is brittle. It must be manually added to each place where `\u003Ch1‑h6>` is used and will break if the theme changes.\n\n### Additional context\n\nScreencast of how the repro example looks:\n\n\nhttps://github.com/user-attachments/assets/28deb3dc-47d4-4c16-9d30-f491cfb58fda\n\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] 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.",[],4867,"vuejs","vitepress","open","Auto‑insert `\u003Ca.header‑anchor>` for headings rendered by Vue components","2025-07-30T19:09:15Z","https://github.com/vuejs/vitepress/issues/4867",0.6719938,{"description":3154,"labels":3155,"number":3159,"owner":3146,"repository":3147,"state":3148,"title":3160,"updated_at":3161,"url":3162,"score":3163},"### Is your feature request related to a problem? Please describe.\n\n1. sometimes need use vue dynamic render highlight content like json list or some thing . if can provide component or function to do that, that will be great.\r\n2. tryed use the vue dynamic component it's not woking , can we use it ? how.\r\n1.有时候需要动态输出 markdown ,能不能加一个从vue 动态输出的功能 。 2. 动态组件用不了,怎么才能用vue 的动态组件\n\n### Describe the solution you'd like\n\n1. sometimes need use vue dynamic render highlight content like json list or some thing . if can provide component or function to do that, that will be great.\r\n2. tryed use the vue dynamic component it's not woking , can we use it ? how.\r\n1.有时候需要动态输出 markdown ,能不能加一个从vue 动态输出的功能 。 2. 动态组件用不了,怎么才能用vue 的动态组件\n\n### Describe alternatives you've considered\n\n_No response_\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] 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.",[3156],{"name":3157,"color":3158},"stale","ededed",4253,"[Feature request] use vue render highlight section","2024-12-03T17:27:43Z","https://github.com/vuejs/vitepress/issues/4253",0.7115931,{"description":3165,"labels":3166,"number":3168,"owner":3146,"repository":3147,"state":3148,"title":3169,"updated_at":3170,"url":3171,"score":3172},"### Is your feature request related to a problem? Please describe.\r\n\r\nsuch as a vue components library site……\r\nA common problem for a documentation page is to show how to use a component, both in code and with demo of live component.\r\n\r\n### Describe the solution you'd like\r\n\r\nlike this [https://github.com/flingyp/vitepress-demo-preview](https://github.com/flingyp/vitepress-demo-preview)\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_No response_\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.",[3167],{"name":3157,"color":3158},3270,"Feature request: Vue component source code demo","2024-01-18T18:48:08Z","https://github.com/vuejs/vitepress/issues/3270",0.7183538,{"description":3174,"labels":3175,"number":3176,"owner":3146,"repository":3147,"state":3148,"title":3177,"updated_at":3178,"url":3179,"score":3180},"### Is your feature request related to a problem? Please describe.\n\nWhen using Vue templates, the Markdown renderer processes them correctly and compiles them. However, in the title, sidenav, and local search (path), the Vue templates are not rendered and are displayed as raw templates.\n\n\u003Cimg width=\"537\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/db835d1f-1084-41c9-bf1c-aa329f4609eb\" />\n\n\u003Cimg width=\"308\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0e1beb6b-d06b-436c-b106-c924fead87ab\" />\n\n\u003Cimg width=\"931\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/aef6f71a-fa28-4b7c-b512-e6386e18159a\" />\n\n### Describe the solution you'd like\n\nIn my [pull request](https://github.com/vuejs/vitepress/pull/4630), I've introduced custom components that can be overridden in the `enhanceApp` function. In these custom components, I can add custom logic for rendering text, such as using the Vue compile function. \n\nAdditionally, I added a flag to skip the title update, allowing for custom logic implementation. \n\nPlease also see my PR: [https://github.com/vuejs/vitepress/pull/4630](https://github.com/vuejs/vitepress/pull/4630).\n\n### Describe alternatives you've considered\n\n_No response_\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] 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.",[],4637,"Sidenav Components / Skip title update","2025-03-20T12:17:14Z","https://github.com/vuejs/vitepress/issues/4637",0.72266567,{"description":3182,"labels":3183,"number":3185,"owner":3146,"repository":3147,"state":3148,"title":3186,"updated_at":3187,"url":3188,"score":3189},"### Is your feature request related to a problem? Please describe.\n\nhttps://vitepress.dev/zh/guide/markdown#markdown-file-inclusion\r\n\r\nThe above link suggests: support markdown full text inline or selective inline by line number.\r\n\r\nIf the line numbers are inline, this can cause unexpected problems if the embedded markdown file changes in the future (line numbers change)\n\n### Describe the solution you'd like\n\ninline by header (H1, H2, H3, etc.)\n\n### Describe alternatives you've considered\n\n_No response_\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] 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.",[3184],{"name":3157,"color":3158},3827,"Inline markdown files do not support inlining by header","2024-06-09T06:01:04Z","https://github.com/vuejs/vitepress/issues/3827",0.7292055,{"description":3191,"labels":3192,"number":3193,"owner":3146,"repository":3147,"state":3194,"title":3195,"updated_at":3196,"url":3197,"score":3198},"### Is your feature request related to a problem? Please describe.\n\nI'm using Vue components that generate headers dynamically, and (of course) the headers I create in Vue components don't appear in the outline.\n\n### Describe the solution you'd like\n\nI'd like to be able to add headers to `page.headers` in my component.\n\n### Describe alternatives you've considered\n\nI tried manipulating `page.headers` in my component from `useData()`, but the headers are read-only at that point.\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.",[],1145,"closed","Dynamic Outline","2023-01-21T14:26:54Z","https://github.com/vuejs/vitepress/issues/1145",0.6727358,{"description":3200,"labels":3201,"number":3205,"owner":3146,"repository":3147,"state":3194,"title":3206,"updated_at":3207,"url":3208,"score":3209},"### Describe the bug\n\nIf you use Vue-style interpolation in a markdown title (# in markdown), the aside curtain \"On this page\" will show the Vue syntax and not the final text. It will also not take into account the fact that multiple secondary title exists from a loop.\n\n### Reproduction\n\nIf you have a markdown file like this with a vfor loop and a interpolation of text for the heading:\r\n\r\n```md\r\n# My great page\r\n## {{element.subtitle}}\r\n```\r\n\r\nThe output will show `{{element.subtitle}}` as text in the aside curtain \"On this page\".\r\n\r\n\n\n### Expected behavior\n\nThe output in the aside curtain \"On this page\" should be the string returned by Vue-style interpolation and take into account the multiple instance of the loop.\r\n\r\n\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.19044\r\n CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz\r\n Memory: 18.71 GB / 31.73 GB\r\n Binaries:\r\n Node: 18.2.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 8.9.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.39)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.1 => 1.0.0-alpha.1\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.",[3202],{"name":3203,"color":3204},"theme","0754FB",785,"Show dynamic headers in aside outline","2023-01-21T14:26:39Z","https://github.com/vuejs/vitepress/issues/785",0.6890783,{"description":3211,"labels":3212,"number":3213,"owner":3146,"repository":3147,"state":3194,"title":3214,"updated_at":3215,"url":3216,"score":3217},"### Is your feature request related to a problem? Please describe.\r\n\r\nI'd like to be able to show more headings on the \"On this page\" menu, as it is not very useful now.\r\n\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\ndisplay headings as a tree, similar to this:\r\n\r\n\r\n\r\n### Describe alternatives you've considered\r\n\r\ncustom css, seems like it would be more useful as a feature though..\r\n\r\n### Additional context\r\n\r\ni looked in vitepress docs and couldn't find this as an option\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.",[],3158,"feature request: allow \"On this page\" menu to show more than h2 headings, like a tree","2023-11-07T00:04:23Z","https://github.com/vuejs/vitepress/issues/3158",0.7129253,{"description":3219,"labels":3220,"number":3222,"owner":3146,"repository":3147,"state":3194,"title":3223,"updated_at":3224,"url":3225,"score":3226},"### Is your feature request related to a problem? Please describe.\n\nFor now, the outline config in frontmatter is not documented, however, the code is in the codebase. Just add `outline: 'deep'` to the page frontmatter and the outline can show 2 levels at most. So I think:\r\n\r\n1. configuration of page outline of frontmatter should be documented.\r\n2. The outline now only has one available type `'deep'`, but I think we should expose a more configurable config, such as `['h1', 'h2']` and an another `deep` type which equals to `['h1', 'h2', 'h3', 'h4', 'h5', 'h6']` for short.\r\n3. I found that `page.headers` is resolved from https://github.com/vuejs/vitepress/blob/22006e8d6e3ed45841979d684eb6a4ef999bd707/src/node/markdown/plugins/headings.ts#L6-L23 I think we can set the default value of `headingPlugin` to `['h1', 'h2', 'h3', 'h4', 'h5', 'h6']` which means markdown-it will parse all headings in node side. And the outline configuration will only control which headings to render in the outline.\n\n### Describe the solution you'd like\n\nThe configuration of the outline will be like\r\n\r\n```ts\r\nType: ('h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6')[] | 'deep'\r\nDefault: ['h2', 'h3']\r\n```\r\n\r\nalso, we need to fix the code which only can handle `[2, 3]` level for now.\n\n### Describe alternatives you've considered\n\nI believe parsing all headings will not cause a performance issue because markdown-it will try to iterate over all blocks (only a guess).\n\n### Additional context\n\nI would like to implement this feature.\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.",[3221],{"name":3203,"color":3204},954,"expose a configurable outline config in frontmatter","2023-01-21T14:26:40Z","https://github.com/vuejs/vitepress/issues/954",0.71359986,{"description":3228,"labels":3229,"number":3231,"owner":3146,"repository":3147,"state":3194,"title":3232,"updated_at":3233,"url":3234,"score":3235},"### Describe the bug\r\n\r\nPage outline will display any headings that has an `id` property. However, activelink only works if a heading has an `\u003Ca>` (anchor) child element.\r\n\r\nIn addition, the offset match fails if the heading is nested in a positioned (i.e. `position: relative`) parent element.\r\n\r\n\r\n### Reproduction\r\n\r\n#### [stackblitz playground](https://stackblitz.com/edit/github-zbjrsg-tsuanj)\r\n\r\n```markdown\r\n# All of the following headings are shown in outline, and can be clicked to jump.\r\n\r\n## (A) I am skipped, thanks to (C)\r\n\r\n\u003Ch2 id=\"B\">(B) I cannot be highlighted due to lack of anchor\u003C/h2>\r\n\r\n\u003Cdiv style=\"position: relative\">\r\n\r\n## (C) ActiveLink thinks my offset is 0.\r\n\r\n\u003C/div>\r\n\r\n## The last heading always works when scrolled to bottom.\r\n\r\n```\r\n\r\n### Expected behavior\r\n\r\nEach of the heading above should get highlighted correctly.\r\n\r\n### System Info\r\n\r\n```Text\r\nNot relevant\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n#### I've provided a fix here: #3368 \r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\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] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3230],{"name":3203,"color":3204},3378,"[default theme] activeAnchor inconsistent with outline when embedding html elements","2024-01-11T00:04:46Z","https://github.com/vuejs/vitepress/issues/3378",0.7230827,["Reactive",3237],{},["Set"],["ShallowReactive",3240],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fbCn6HaKUWwtRKYATZHNSEZj7m9LzewWTdBhGzPQF_XM":-1},"/vuejs/vitepress/3103"]