From a38313f57b40dfdc7df9cc11b757c117db4cc839 Mon Sep 17 00:00:00 2001 From: GaoNeng-wWw Date: Sun, 4 Dec 2022 14:55:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EPC=E7=AB=AF?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/doc/content.vue | 61 +++++++++++++++++++++++++++++++------- nuxt.config.ts | 2 +- pages/doc/[...slug].vue | 8 +++-- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/components/doc/content.vue b/components/doc/content.vue index 7b38ebd..0a4e59c 100644 --- a/components/doc/content.vue +++ b/components/doc/content.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index ec50ec0..26556ab 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -53,7 +53,7 @@ export default defineNuxtConfig({ ws: { hostname: 'localhost' } - }, + } }, css: ['vue-devui/style.css', '@devui-design/icons/icomoon/devui-icon.css', '~/assets/styles/common.scss'], postcss: { diff --git a/pages/doc/[...slug].vue b/pages/doc/[...slug].vue index cb31f2a..38e1f6e 100644 --- a/pages/doc/[...slug].vue +++ b/pages/doc/[...slug].vue @@ -19,10 +19,11 @@ import Banner from '~/components/common/banner/index.vue' import Content from '~/components/doc/content.vue'; import { useImage } from '@/hooks/useImage'; -import { ref } from 'vue'; -const { page } = useContent(); +import { ref, Ref } from 'vue'; +const { page, toc } = useContent(); const currentTitle = ref(page.value?.title ?? ''); const bannerImage = ref(useImage((page.value?.bg as string) ?? '')); +// let obj = { "title": "", "searchDepth": 2, "depth": 2, "links": [{ "id": "家庭暴力的构成", "depth": 2, "text": "家庭暴力的构成", "children": [{ "id": "施暴方", "depth": 3, "text": "施暴方" }, { "id": "受害方", "depth": 3, "text": "受害方" }] }, { "id": "辨别", "depth": 2, "text": "辨别", "children": [{ "id": "身体上", "depth": 3, "text": "身体上" }, { "id": "精神上", "depth": 3, "text": "精神上" }, { "id": "经济上", "depth": 3, "text": "经济上" }] }, { "id": "危害", "depth": 2, "text": "危害" }, { "id": "解决", "depth": 2, "text": "解决" }, { "id": "数字安全", "depth": 2, "text": "数字安全" }, { "id": "图片来源声明", "depth": 2, "text": "图片来源声明" }, { "id": "footnote-label", "depth": 2, "text": "Footnotes" }] }