diff --git a/.gitignore b/.gitignore index b512c09..76add87 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +dist \ No newline at end of file diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 7513580..61602cd 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -1,3 +1,5 @@ +import menu from "./menu"; + module.exports = { lang: "zh-CN", title: "Vue-H5-Template", @@ -11,7 +13,7 @@ module.exports = { themeConfig: { nav: nav(), sidebar: { - "/guide/": sidebarGuide(), + "/guide/": menu, }, socialLinks: [ { icon: "github", link: "https://github.com/sunniejs/vue-h5-template" }, @@ -37,67 +39,9 @@ function nav() { return [ { text: "介绍", link: "/guide/" }, { text: "加入我们", link: "/guide/about/" }, - { text: "github仓库", link: "https://github.com/sunniejs/vue-h5-template" }, - ]; -} - -function sidebarGuide() { - return [ { - text: "前言", - collapsible: true, - items: [ - { text: "介绍", link: "/guide/" }, - { text: "快速上手", link: "/guide/start" }, - { text: "参与编辑", link: "/guide/edit" }, - ], - }, - { - text: "vue3-template", - collapsible: true, - items: [ - { text: "启动项目", link: "/guide/vue3/start" }, - { text: "vite.config.ts 基础配置", link: "/guide/vue3/base" }, - { text: "vite插件集成", link: "/guide/vue3/vite" }, - { text: "多环境变量", link: "/guide/vue3/env" }, - { text: "viewport 适配方案", link: "/guide/vue3/viewport" }, - { text: "UI组件库", link: "/guide/vue3/ui" }, - { text: "Pinia 状态管理", link: "/guide/vue3/pinia" }, - { text: "vue-router", link: "/guide/vue3/router" }, - { text: "axios 封装及接口管理", link: "/guide/vue3/axios" }, - { text: "alias", link: "/guide/vue3/alias" }, - { text: "proxy 跨域", link: "/guide/vue3/proxy" }, - { text: "多语言解决方案", link: "/guide/vue3/i18n" }, - { - text: "统一开发规范", - link: "/guide/vue3/lint", - }, - ], - }, - { - text: "vue2-template", - collapsible: true, - collapsed: true, - items: [ - { text: "启动项目", link: "/guide/vue2/start" }, - { text: "多环境变量", link: "/guide/vue2/env" }, - { text: "rem 适配方案", link: "/guide/vue2/rem" }, - { text: "vw 适配方案", link: "/guide/vue2/vw" }, - { text: "VantUI 组件按需加载", link: "/guide/vue2/vant" }, - { text: "Sass 全局样式", link: "/guide/vue2/sass" }, - { text: "Vuex 状态管理", link: "/guide/vue2/vuex" }, - { text: "Vue-router", link: "/guide/vue2/router" }, - { text: "Axios 封装及接口管理", link: "/guide/vue2/axios" }, - { text: "vue.config.js 基础配置", link: "/guide/vue2/base" }, - { text: "配置 alias 别名", link: "/guide/vue2/alias" }, - { text: "配置 proxy 跨域", link: "/guide/vue2/proxy" }, - { text: "配置 打包分析", link: "/guide/vue2/bundle" }, - { text: "配置 externals 引入 cdn 资源", link: "/guide/vue2/externals" }, - { text: "去掉 console.log", link: "/guide/vue2/console" }, - { text: "splitChunks 打包第三方模块", link: "/guide/vue2/chunks" }, - { text: "添加 IE 兼容", link: "/guide/vue2/ie" }, - { text: "统一开发规范", link: "/guide/vue2/lint" }, - ], + text: "github仓库", + link: "https://github.com/sunniejs/vue-h5-template", }, ]; } diff --git a/docs/.vitepress/menu/index.js b/docs/.vitepress/menu/index.js new file mode 100644 index 0000000..819b9b8 --- /dev/null +++ b/docs/.vitepress/menu/index.js @@ -0,0 +1,5 @@ +import preface from "./preface"; +import vue2 from "./vue2"; +import vue3 from "./vue3"; + +export default [preface, vue3, vue2]; diff --git a/docs/.vitepress/menu/preface.js b/docs/.vitepress/menu/preface.js new file mode 100644 index 0000000..d63550f --- /dev/null +++ b/docs/.vitepress/menu/preface.js @@ -0,0 +1,9 @@ +export default { + text: "前言", + collapsible: true, + items: [ + { text: "介绍", link: "/guide/" }, + { text: "快速上手", link: "/guide/start" }, + { text: "参与编辑", link: "/guide/edit" }, + ], +}; diff --git a/docs/.vitepress/menu/vue2.js b/docs/.vitepress/menu/vue2.js new file mode 100644 index 0000000..3b304fc --- /dev/null +++ b/docs/.vitepress/menu/vue2.js @@ -0,0 +1,25 @@ +export default { + text: "vue2-template", + collapsible: true, + collapsed: true, + items: [ + { text: "启动项目", link: "/guide/vue2/start" }, + { text: "多环境变量", link: "/guide/vue2/env" }, + { text: "rem 适配方案", link: "/guide/vue2/rem" }, + { text: "vw 适配方案", link: "/guide/vue2/vw" }, + { text: "VantUI 组件按需加载", link: "/guide/vue2/vant" }, + { text: "Sass 全局样式", link: "/guide/vue2/sass" }, + { text: "Vuex 状态管理", link: "/guide/vue2/vuex" }, + { text: "Vue-router", link: "/guide/vue2/router" }, + { text: "Axios 封装及接口管理", link: "/guide/vue2/axios" }, + { text: "vue.config.js 基础配置", link: "/guide/vue2/base" }, + { text: "配置 alias 别名", link: "/guide/vue2/alias" }, + { text: "配置 proxy 跨域", link: "/guide/vue2/proxy" }, + { text: "配置 打包分析", link: "/guide/vue2/bundle" }, + { text: "配置 externals 引入 cdn 资源", link: "/guide/vue2/externals" }, + { text: "去掉 console.log", link: "/guide/vue2/console" }, + { text: "splitChunks 打包第三方模块", link: "/guide/vue2/chunks" }, + { text: "添加 IE 兼容", link: "/guide/vue2/ie" }, + { text: "统一开发规范", link: "/guide/vue2/lint" }, + ], +}; diff --git a/docs/.vitepress/menu/vue3.js b/docs/.vitepress/menu/vue3.js new file mode 100644 index 0000000..1f2c3ba --- /dev/null +++ b/docs/.vitepress/menu/vue3.js @@ -0,0 +1,22 @@ +export default { + text: "vue3-template", + collapsible: true, + items: [ + { text: "启动项目", link: "/guide/vue3/start" }, + { text: "vite.config.ts 基础配置", link: "/guide/vue3/base" }, + { text: "vite插件集成", link: "/guide/vue3/vite" }, + { text: "多环境变量", link: "/guide/vue3/env" }, + { text: "viewport 适配方案", link: "/guide/vue3/viewport" }, + { text: "UI组件库", link: "/guide/vue3/ui" }, + { text: "Pinia 状态管理", link: "/guide/vue3/pinia" }, + { text: "vue-router", link: "/guide/vue3/router" }, + { text: "axios 封装及接口管理", link: "/guide/vue3/axios" }, + { text: "alias", link: "/guide/vue3/alias" }, + { text: "proxy 跨域", link: "/guide/vue3/proxy" }, + { text: "多语言解决方案", link: "/guide/vue3/i18n" }, + { + text: "统一开发规范", + link: "/guide/vue3/lint", + }, + ], +};