右上角两侧小标志怎样进行设置:
这里两侧的图标,是由nav组件控制,想要修改这里的内容,只要在config.js中配置nav就可以了
export default { title: '文档', // 站点的标题 description: '第一个 VitePress',// 站点的描述, themeConfig: { nav: [ { text: 'Home', link: '/' }, { text: 'Examples', link: '/markdown-examples' } ], sidebar: [ { text: 'Examples', items: [ { text: 'Markdown Examples', link: '/markdown-examples' }, { text: 'Runtime API Examples', link: '/api-examples' } ] } ], socialLinks: [ { icon: 'github', link: 'https://github.com/vuejs/vitepress' } ] , footer: { copyright: "Copyright " }, // 设置搜索框的样式 search: { provider: "local", options: { translations: { button: { buttonText: "搜索文档", buttonAriaLabel: "搜索文档", }, modal: { noResultsText: "无法找到相关结果", resetButtonTitle: "清除查询条件", footer: { selectText: "选择", navigateText: "切换", }, }, }, }, }, } }
想要设置成这种下拉框,如何进行设置????
这里要在nav中进行修正,资料如下,具体的写法要写成:
这里的修改点是在themeConfig中下成数组的集合,然后再添加你想要的例外展示页面
themeConfig: {
nav: [
{
text: '家', items: [
{ text: '首页', link: '/' },
{ text: 'markdows示例', link: '/markdown-examples' }
]
},
{ text: '首页', link: '/markdown-examples' }
]}
export default { title: '文档', // 站点的标题 description: '第一个 VitePress',// 站点的描述, themeConfig: { nav: [ { text: '家', items: [ { text: '首页', link: '/' }, { text: 'markdows示例', link: '/markdown-examples' } ] }, { text: '首页', link: '/markdown-examples' } ], sidebar: [ { text: 'Examples', items: [ { text: 'Markdown Examples', link: '/markdown-examples' }, { text: 'Runtime API Examples', link: '/api-examples' } ] } ], socialLinks: [ { icon: 'github', link: 'https://github.com/vuejs/vitepress' } ] , footer: { copyright: "Copyright " }, // 设置搜索框的样式 search: { provider: "local", options: { translations: { button: { buttonText: "搜索文档", buttonAriaLabel: "搜索文档", }, modal: { noResultsText: "无法找到相关结果", resetButtonTitle: "清除查询条件", footer: { selectText: "选择", navigateText: "切换", }, }, }, }, }, } }