vuepress使用
# vuepress 1.9.7
V1版本: https://v1.vuepress.vuejs.org/zh/
V2版本:打包工具是 Vite https://v2.vuepress.vuejs.org/zh/
vuepress 中文:
http://caibaojian.com/vuepress/guide/
# 使用来自依赖的主题
一个主题可以在以 vuepress-theme-xxx 的形式发布到 npm,你可以这样使用它:
安装:侧边栏自动展示主题
npm install vuepress-theme-vdoing -D
.vuepress/config.js
module.exports = {
theme: 'vdoing'
}
# 主题的缩写
如果你的主题名以 vuepress-theme- 开头,你可以使用缩写来省略这个前缀:
.vuepress/config.js
module.exports = {
theme: 'xxx'
}
和下面等价:
.vuepress/config.js
module.exports = {
theme: 'vuepress-theme-xxx'
}
这也适用于 Scoped Packages (opens new window):
.vuepress/config.js
module.exports = {
theme: '@org/vuepress-theme-xxx', // 或者一个官方主题: '@vuepress/theme-xxx'
}
缩写:
.vuepress/config.js
module.exports = {
theme: '@org/xxx', // 或者一个官方主题: '@vuepress/xxx'
}
注意
以 @vuepress/theme- 开头的主题是官方维护的主题。
提示
这是一个提示
注意
这是一个警告
警告
这是一个危险警告
点击查看
这是一个详情块,在 IE / Edge 中不生效
静态图片:
真实路径下md 显示图片:

Vuepress 显示图片:
<img :src="$withBase('/images/C/hellofilestring.png')" alt="hello">