From 6e9646e28d36354402290a3c5d1d1e16245b7b99 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Fri, 8 Jul 2022 17:48:49 +0800 Subject: [PATCH] feat: Improve toc display --- docs/.vuepress/config.js | 3 +- docs/.vuepress/theme/components/Toc-top.vue | 45 ++++++ docs/.vuepress/theme/components/Toc.vue | 12 +- docs/.vuepress/theme/layouts/Layout.vue | 5 +- docs/.vuepress/theme/styles/index.styl | 146 +++++++++++--------- docs/.vuepress/theme/styles/palette.styl | 2 +- 6 files changed, 136 insertions(+), 77 deletions(-) create mode 100644 docs/.vuepress/theme/components/Toc-top.vue diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index b86890e5b..820aeb3d0 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -24,7 +24,7 @@ const config = { logo: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/5a7f902b-21a7-4822-884f-925219eacc4b.png', // TODO use plugin/theme sidebar: createSidebar(tabs), - // sidebarDepth: 2, + sidebarDepth: 0, nextLinks: false, prevLinks: false, // TODO use theme @@ -44,6 +44,7 @@ const config = { } }, markdown: { + // toc: { includeLevel: [1, 2, 3, 4] }, slugify(str) { if (typeof str !== 'string') return '' diff --git a/docs/.vuepress/theme/components/Toc-top.vue b/docs/.vuepress/theme/components/Toc-top.vue new file mode 100644 index 000000000..a5bd64116 --- /dev/null +++ b/docs/.vuepress/theme/components/Toc-top.vue @@ -0,0 +1,45 @@ + + + diff --git a/docs/.vuepress/theme/components/Toc.vue b/docs/.vuepress/theme/components/Toc.vue index b2f14aefa..5db5de54b 100644 --- a/docs/.vuepress/theme/components/Toc.vue +++ b/docs/.vuepress/theme/components/Toc.vue @@ -1,14 +1,14 @@