安装/使用
大约 1 分钟
要求
- 环境: LTS 版本 的 Node.js (^20.6.0, ^22.0.0)
- 包管理器: npm >= 8、yarn >= 2 或 pnpm >= 7
- 使用 Vue3 的 VuePress2 项目
安装
在 <dir> 文件夹内新建 vuepress-theme-hope 项目:
pnpm
pnpm create vuepress-theme-hope <dir>yarn
yarn create vuepress-theme-hope <dir>npm
npm init vuepress-theme-hope@latest <dir>要将 vuepress-theme-hope 作为文档构建器添加到现有项目中,请在项目根目录中运行以下命令:
pnpm
pnpm create vuepress-theme-hope add <dir>yarn
yarn create vuepress-theme-hope add <dir>npm
npm init vuepress-theme-hope@latest add <dir>重要
这里的 <dir> 是一个参数,你需要使用真实的文件夹名称替换它,例如 docs、blog 或其他你喜欢的名称。
使用与配置
请在配置文件中导入并使用 hopeTheme 以使用 vuepress-theme-hope,hopeTheme 接受的第一个参数会作为主题配置:
import { defineUserConfig } from "vuepress";
import { hopeTheme } from "vuepress-theme-hope";
export default defineUserConfig({
theme: hopeTheme({
// 此处放置主题配置
}),
});你可以查看 本文档配置 作为一个配置参考。
更新日志
2025/4/27 07:07
查看所有更新日志
c611b-于b9506-于b1230-于8289f-于22787-于2c32a-于6d493-于b41c0-于7d82b-于54c46-于16c4f-于5c0cb-于1ba82-于94e9b-于24b0b-于5e7ca-于8174c-于f7e60-于9a16a-于2fa50-于f4127-于9856d-于23515-于9cdd7-于63d09-于e07b5-于fd395-于1eb77-于fc15c-于bcf02-于f6ff0-于47206-于3c199-于