diff --git a/packages/fes-doc/docs/.vuepress/config.js b/packages/fes-doc/docs/.vuepress/config.js index e3166068..0ca45e97 100644 --- a/packages/fes-doc/docs/.vuepress/config.js +++ b/packages/fes-doc/docs/.vuepress/config.js @@ -1,13 +1,16 @@ module.exports = { base: "/fes.js/", title: "Fes.js", - description: "Curd应用快速解决方案", + description: "中台应用前端快速解决方案", themeConfig: { + repo: "WeBankFinTech/fes.js", + sidebarDepth: 3, + lastUpdated: "上次编辑时间", nav: [ { text: "指南", link: "/guide/" }, { text: "API参考", link: "/api/" }, - { text: "组件", link: "/ui/" }, - { text: "CLI", link: "/cli/" } + { text: "组件", link: "/ui/" } + // { text: "CLI", link: "/cli/" } ], sidebar: { "/guide/": [ @@ -16,15 +19,15 @@ module.exports = { collapsable: false, sidebarDepth: 1, children: [ - "", - "install", - "play", - "directory-structure", - "layout", - "route", - "permisson", - "i18n", - "option" + "/guide/", + "/guide/install.md", + "/guide/play", + "/guide/directory-structure", + "/guide/layout", + "/guide/route", + "/guide/permisson", + "/guide/i18n", + "/guide/option" ] }, { @@ -32,7 +35,7 @@ module.exports = { collapsable: false, sidebarDepth: 1, children: [] - }, + } // { // title: "迁移", // collapsable: false, @@ -40,54 +43,52 @@ module.exports = { // children: ["migration", "migrationLast"] // } ], - "/api/": [""], + "/api/": ["/api/"], "/ui/": [ - "", + "/ui/", { title: "组件库", collapsable: false, sidebarDepth: 1, children: [ - "layout", - "icon", - "button", - "menu", - "dropdown", - "contextmenu", - "collapse", - "tab", - "table", - "pagination", - "panel", - "tree", - "step", - "zoom", - "carousel", - "toast", - "message", - "modal", - "tooltip", - "loading", - "process-circle", - "input", - "select", - "radio", - "checkbox", - "datePicker", - "timePicker", - "switch", - "form", - "upload", - // "affix", - 'backTop', - 'draggable', - "split", + "/ui/layout", + "/ui/icon", + "/ui/button", + "/ui/menu", + "/ui/dropdown", + "/ui/contextmenu", + "/ui/collapse", + "/ui/tab", + "/ui/table", + "/ui/pagination", + "/ui/panel", + "/ui/tree", + "/ui/step", + "/ui/zoom", + "/ui/carousel", + "/ui/toast", + "/ui/message", + "/ui/modal", + "/ui/tooltip", + "/ui/loading", + "/ui/process-circle", + "/ui/input", + "/ui/select", + "/ui/radio", + "/ui/checkbox", + "/ui/datePicker", + "/ui/timePicker", + "/ui/switch", + "/ui/form", + "/ui/upload", + // "/ui/affix", + "/ui/backTop", + "/ui/draggable", + "/ui/split" ] } - ], + ] // "/cli/": [{}] - }, - lastUpdated: "Last Updated", - smoothScroll: true + } } }; diff --git a/packages/fes-doc/docs/.vuepress/enhanceApp.js b/packages/fes-doc/docs/.vuepress/enhanceApp.js index 5b3adfa2..f18d8bc1 100644 --- a/packages/fes-doc/docs/.vuepress/enhanceApp.js +++ b/packages/fes-doc/docs/.vuepress/enhanceApp.js @@ -1,5 +1,6 @@ // 使用异步函数也是可以的 import "@webank/fes-ui/dist/styles/fes-ui.css"; +let installed = false; export default ({ Vue, // VuePress 正在使用的 Vue 构造函数 options, // 附加到根实例的一些选项 @@ -7,14 +8,20 @@ export default ({ siteData, // 站点元数据 isServer // 当前应用配置是处于 服务端渲染 或 客户端 }) => { - Vue.mixin({ - mounted(){ - import("@webank/fes-ui").then(({ default: UiWebank }) => { - // install 组件库 - Vue.use(UiWebank, { - locale: "zh-cn" - }); - }); + return new Promise(function(resole, reject) { + if (!isServer) { + import("@webank/fes-ui") + .then(({ default: UiWebank }) => { + installed = true; + // install 组件库 + Vue.use(UiWebank, { + locale: "zh-cn" + }); + resole(); + }) + .catch(reject); + } else { + resole(); } - }) + }); }; diff --git a/packages/fes-doc/package.json b/packages/fes-doc/package.json index 5630854f..acf1cc30 100644 --- a/packages/fes-doc/package.json +++ b/packages/fes-doc/package.json @@ -19,7 +19,9 @@ "devDependencies": { "sass": "^1.26.10", "sass-loader": "^9.0.2", - "vuepress": "^1.5.2" + "vuepress": "^1.5.4", + "@vuepress/plugin-pwa": "^1.5.0", + "@vuepress/theme-vue": "^1.5.0" }, "dependencies": { "@webank/fes-ui": "^0.1.0"