快捷菜单
常用功能一站直达
更多功能请点顶栏「快捷菜单」
docs\.vitepress\theme\components\ConfigSwitch.vue文件

docs\.vitepress\theme\components\TeekLayoutProvider.vue文件:

在无痕浏览器打开,可以看到默认是文档风格的:

之前默认是文档风格,这里修改默认为博客风格。
测试环境:
Teek@1.5.0-2025.9.23
自己的开源库《vitepress-theme-teek-one》 –(克隆自 作者Teeker的文档风开源库《vitepress-theme-teek-docs-template》)
2025年9月24日测试
(1)编辑docs\.vitepress\theme\components\TeekLayoutProvider.vue文件:
注释掉docs风格,添加如下代码:
1// 默认文档风
2// import { teekDocConfig } from "../config/teekConfig";
3
4// 默认博客风
5import { teekBlogCardConfig } from "../config/teekConfig";
6
7
8// 默认文档风
9// const currentStyle = ref("doc");
10// const teekConfig = ref(teekDocConfig);
11
12// 默认博客风
13const currentStyle = ref("blog-card");
14const teekConfig = ref(teekBlogCardConfig);
(2)编辑docs\.vitepress\theme\components\ConfigSwitch.vue文件:
注释博客风格,去掉docs风格注释
1// 默认文档风格
2// const themeStyle = defineModel({ default: "doc" });
3// const currentStyle = useStorage("tk:configStyle", "doc");
4
5// 默认博客风格
6const themeStyle = defineModel({ default: "blog-card" });
7const currentStyle = useStorage("tk:configStyle", "blog-card");
8
9const teekConfig = ref(teekDocConfig);
验证:在无痕浏览器打开,可以看到默认是博客风格的:

结束。
日历 · 精选 · 友链 · 更多
如果内容对你有帮助,欢迎请我喝杯咖啡 ☕



One的公众号
爱折腾博客的小白