今天在使用 vitepress出现了乱序的问题
这里该怎样解决:
config的配置文件:
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 " } } }
自己index.md里的内容,不显色,这里出错的错误是没有加---
正确的写法:一定要加---,否则是乱序的,自己粗心导致的,这里参考了大佬白小纯纯纯的资料
--- layout: home hero: name: 名称 text: 文本 tagline: 标语 actions: - theme: brand text: 开始 link: /guide/what-is-vitepress - theme: alt text: View on GitHub link: https://github.com/vuejs/vitepress features: - icon: ⚡️ title: Vite, The DX that can't be beat details: Lorem ipsum... - icon: 🖖 title: Power of Vue meets Markdown details: Lorem ipsum... - icon: 🛠️ title: Simple and minimal, always details: Lorem ipsum... --- <style> :root { --vp-home-hero-name-color: transparent; --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe, #41d1ff); } </style>
最终样式: