From b0cf2a1ba8228e6f845a894c90037a2dd0340956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E7=BA=AF?= Date: Wed, 2 Sep 2020 12:09:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=BC=96=E8=AF=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E6=96=87=E6=A1=A3=E5=88=B7=E6=96=B0=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=85=B6=E4=BB=96=E9=A1=B5=E9=9D=A2=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-doc/docs/.vuepress/config.js | 107 +++++++++--------- packages/fes-doc/docs/.vuepress/enhanceApp.js | 25 ++-- packages/fes-doc/package.json | 4 +- 3 files changed, 73 insertions(+), 63 deletions(-) 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"