1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| import type { UserConfig, HeadConfig } from "vitepress";
// 在html文档增加一些通用的脚本script、样式css、meta等 const head: HeadConfig[] = [ [ "script", {}, `;(() => { console.log('script'); })()`, ], ];
// 顶部导航配置 const nav = [ { text: "基础组件", link: "/component/" }, { text: "高级组件", link: "/business/"}, { text: "可视化组件", link: "/visualization/" }, ];
// 侧边导航配置
const sidebar = { '/component/': [ { text: '开始', collapsible: true, items: [ {text:'如何使用', link: '/component/'}, ] }, { text:'通用', collapsible: true, items: [ {text:'Button 按钮', link:'/component/button'}, ], }, ], '/business/': [ { text: '介绍', collapsible: true, items: [ {text:'如何使用',link: '/business/'}, ] }, ], '/visualization/': [ { text: '介绍', collapsible: true, items: [ {text:'如何使用',link: '/visualization/'}, ] }, ] }
const config: UserConfig = { title: "文档库", description: "此处是描述", lang: 'zh-CN', lastUpdated: true, ignoreDeadLinks: true, base: "", head, themeConfig: { nav, sidebar, smoothScroll: true, }, };
export default config;
|