diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index e4844a1387..d683ccf9d9 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -7,10 +7,11 @@ import { VdoingThemeConfig } from 'vuepress-theme-vdoing/types' import dayjs from 'dayjs' import baiduCode from './config/baiduCode' // 百度统计hm码 import htmlModules from './config/htmlModules' // 自定义插入的html块 +import catalogueLink from "./config/catalogueLink"; export default defineConfig4CustomTheme({ - theme: 'vdoing', // 使用npm包主题 - // theme: resolve(__dirname, '../../vdoing'), // 使用本地主题 + // theme: 'vdoing', // 使用npm包主题 + theme: resolve(__dirname, '../../vdoing'), // 使用本地主题 locales: { '/': { @@ -23,6 +24,7 @@ export default defineConfig4CustomTheme({ // 主题配置 themeConfig: { + catalogueLink, // 导航配置 nav: [ { text: '首页', link: '/' }, diff --git a/docs/.vuepress/config/catalogueLink.ts b/docs/.vuepress/config/catalogueLink.ts new file mode 100644 index 0000000000..026d13d1ec --- /dev/null +++ b/docs/.vuepress/config/catalogueLink.ts @@ -0,0 +1,91 @@ +// 目录链接映射配置 +export default { + // 是否展开(默认true) + expand: true, + // 是否显示图标(默认false) + iconShow: false, + // 树形序号相关的设置 + treeNumberSet: { + // 序号显示的总开关(默认true) + show: true, + // 序号显示到的级别(此处填写整数,例如:1、2、3。默认-1,负数表示显示全部级别。) + level: -1, + // 只有链接才显示序号(默认false) + onlyLink: false, + // 链接是否显示序号(默认true) + link: true, + }, + // 目录链接映射 + linksMap: [ + // 这是第一种配置:树形(有children) + { + catalogueLink: '/tree-demo', + title: '一级标题', + children: [ + { + title: '二级标题1', + items: [ + { text: '二级标题1 - 三级链接1', link: '/demo-link/' }, + { text: '二级标题1 - 三级链接2', link: '/demo-link/' }, + ], + children: [ + { + title: '三级标题1', + items: [ + { text: '三级标题1 - 四级链接1', link: '/demo-link/' }, + { text: '三级标题1 - 四级链接2', link: '/demo-link/' }, + { text: '三级标题1 - 四级链接3', link: '/demo-link/' }, + ], + }, + { + title: '三级标题2', + items: [ + { text: '三级标题2 - 四级链接1', link: '/demo-link/' }, + { text: '三级标题2 - 四级链接2', link: '/demo-link/' }, + ], + children: [ + { + title: '四级标题1', + items: [ + { text: '四级标题1 - 五级链接1', link: '/demo-link/' }, + { text: '四级标题1 - 五级链接2', link: '/demo-link/' }, + ], + }, + { + title: '四级标题2', + items: [ + { text: '四级标题2 - 五级链接1', link: '/demo-link/' }, + ], + }, + ], + }, + ], + }, + { + title: '二级标题2', + items: [ + { text: '二级标题2 - 三级链接1', link: '/demo-link/' }, + ], + children: [ + { + title: '三级标题1', + items: [ + { text: '三级标题1 - 四级链接1', link: '/demo-link/' }, + ], + } + ] + }, + ], + }, + // 这是第二种配置:非树形(没有children,只有items) + { + catalogueLink: '/no-tree-demo/', + items: [ + { text: '非树形1', link: '/demo-link/' }, + { text: '非树形2', link: '/demo-link/' }, + { text: '非树形3', link: '/demo-link/' }, + ], + } + ] + +} \ No newline at end of file diff --git "a/docs/00.\347\233\256\345\275\225\351\241\265/05.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\346\240\221\345\275\242\346\274\224\347\244\272.md" "b/docs/00.\347\233\256\345\275\225\351\241\265/05.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\346\240\221\345\275\242\346\274\224\347\244\272.md" new file mode 100644 index 0000000000..d8687be95d --- /dev/null +++ "b/docs/00.\347\233\256\345\275\225\351\241\265/05.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\346\240\221\345\275\242\346\274\224\347\244\272.md" @@ -0,0 +1,15 @@ +--- +pageComponent: + name: Catalogue + data: + key: CatalogueLink + imgUrl: /img/more.png + description: 这是目录链接映射-树形演示 +title: 目录链接映射-树形演示 +date: 2022-04-05 21:23:16 +permalink: /tree-demo +sidebar: false +article: false +comment: false +editLink: false +--- diff --git "a/docs/00.\347\233\256\345\275\225\351\241\265/06.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\351\235\236\346\240\221\345\275\242\346\274\224\347\244\272.md" "b/docs/00.\347\233\256\345\275\225\351\241\265/06.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\351\235\236\346\240\221\345\275\242\346\274\224\347\244\272.md" new file mode 100644 index 0000000000..d12fc785cb --- /dev/null +++ "b/docs/00.\347\233\256\345\275\225\351\241\265/06.\347\233\256\345\275\225\351\223\276\346\216\245\346\230\240\345\260\204-\351\235\236\346\240\221\345\275\242\346\274\224\347\244\272.md" @@ -0,0 +1,15 @@ +--- +pageComponent: + name: Catalogue + data: + key: CatalogueLink + imgUrl: /img/more.png + description: 这是目录链接映射-非树形演示 +title: 目录链接映射-非树形演示 +date: 2022-04-05 21:23:16 +permalink: /no-tree-demo +sidebar: false +article: false +comment: false +editLink: false +--- diff --git a/vdoing/components/Catalogue.vue b/vdoing/components/Catalogue.vue index c2648e9b54..9ee403b8f0 100644 --- a/vdoing/components/Catalogue.vue +++ b/vdoing/components/Catalogue.vue @@ -64,14 +64,18 @@ + \ No newline at end of file diff --git a/vdoing/components/CatalogueLinkChildrenItems.vue b/vdoing/components/CatalogueLinkChildrenItems.vue new file mode 100644 index 0000000000..9e12040f66 --- /dev/null +++ b/vdoing/components/CatalogueLinkChildrenItems.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/vdoing/components/CatalogueLinkNoTree.vue b/vdoing/components/CatalogueLinkNoTree.vue new file mode 100644 index 0000000000..43f0daed55 --- /dev/null +++ b/vdoing/components/CatalogueLinkNoTree.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/vdoing/components/CatalogueLinkTree.vue b/vdoing/components/CatalogueLinkTree.vue new file mode 100644 index 0000000000..08c9653199 --- /dev/null +++ b/vdoing/components/CatalogueLinkTree.vue @@ -0,0 +1,95 @@ + + + + + + + diff --git a/vdoing/components/CatalogueLinkTreeItem.vue b/vdoing/components/CatalogueLinkTreeItem.vue new file mode 100644 index 0000000000..3e21c58c59 --- /dev/null +++ b/vdoing/components/CatalogueLinkTreeItem.vue @@ -0,0 +1,157 @@ + + + + +