diff --git a/__tests__/unit/client/theme-default/composables/outline.test.ts b/__tests__/unit/client/theme-default/composables/outline.test.ts index 06180f1a..f32d68aa 100644 --- a/__tests__/unit/client/theme-default/composables/outline.test.ts +++ b/__tests__/unit/client/theme-default/composables/outline.test.ts @@ -7,14 +7,23 @@ describe('client/theme-default/composables/outline', () => { resolveHeaders( [ { - level: 2, - title: 'h2 - 1', - link: '#h2-1' - }, - { - level: 3, - title: 'h3 - 1', - link: '#h3-1' + level: 1, + title: 'h1 - 1', + link: '#h1-1', + children: [ + { + level: 2, + title: 'h2 - 1', + link: '#h2-1', + children: [ + { + level: 3, + title: 'h3 - 1', + link: '#h3-1' + } + ] + } + ] } ], [2, 3] @@ -42,12 +51,14 @@ describe('client/theme-default/composables/outline', () => { { level: 2, title: 'h2 - 1', - link: '#h2-1' - }, - { - level: 3, - title: 'h3 - 1', - link: '#h3-1' + link: '#h2-1', + children: [ + { + level: 3, + title: 'h3 - 1', + link: '#h3-1' + } + ] } ], 2 @@ -68,42 +79,52 @@ describe('client/theme-default/composables/outline', () => { { level: 2, title: 'h2 - 1', - link: '#h2-1' - }, - { - level: 3, - title: 'h3 - 1', - link: '#h3-1' - }, - { - level: 4, - title: 'h4 - 1', - link: '#h4-1' - }, - { - level: 3, - title: 'h3 - 2', - link: '#h3-2' - }, - { - level: 4, - title: 'h4 - 2', - link: '#h4-2' + link: '#h2-1', + children: [ + { + level: 3, + title: 'h3 - 1', + link: '#h3-1', + children: [ + { + level: 4, + title: 'h4 - 1', + link: '#h4-1' + } + ] + }, + { + level: 3, + title: 'h3 - 2', + link: '#h3-2', + children: [ + { + level: 4, + title: 'h4 - 2', + link: '#h4-2' + } + ] + } + ] }, { level: 2, title: 'h2 - 2', - link: '#h2-2' - }, - { - level: 3, - title: 'h3 - 3', - link: '#h3-3' - }, - { - level: 4, - title: 'h4 - 3', - link: '#h4-3' + link: '#h2-2', + children: [ + { + level: 3, + title: 'h3 - 3', + link: '#h3-3', + children: [ + { + level: 4, + title: 'h4 - 3', + link: '#h4-3' + } + ] + } + ] } ], 'deep' diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9b93db80..6c4210f0 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -14,12 +14,6 @@ export default defineConfig({ head: [['meta', { name: 'theme-color', content: '#3c8772' }]], - markdown: { - headers: { - level: [0, 0] - } - }, - themeConfig: { nav: nav(), diff --git a/src/client/app/components/Content.ts b/src/client/app/components/Content.ts index 32a910cf..a6421d5e 100644 --- a/src/client/app/components/Content.ts +++ b/src/client/app/components/Content.ts @@ -1,17 +1,13 @@ -import { defineComponent, h, onUpdated } from 'vue' +import { defineComponent, h } from 'vue' import { useRoute } from '../router.js' export const Content = defineComponent({ name: 'VitePressContent', props: { - onContentUpdated: Function, as: { type: [Object, String], default: 'div' } }, setup(props) { const route = useRoute() - onUpdated(() => { - props.onContentUpdated?.() - }) return () => h(props.as, { style: { position: 'relative' } }, [ route.component ? h(route.component) : null diff --git a/src/client/theme-default/components/VPDoc.vue b/src/client/theme-default/components/VPDoc.vue index bcec9e6a..70557157 100644 --- a/src/client/theme-default/components/VPDoc.vue +++ b/src/client/theme-default/components/VPDoc.vue @@ -1,6 +1,6 @@