diff --git a/docs/zh/reference/plugin/plugins/layout.md b/docs/zh/reference/plugin/plugins/layout.md index 3e583132..e00ebaca 100644 --- a/docs/zh/reference/plugin/plugins/layout.md +++ b/docs/zh/reference/plugin/plugins/layout.md @@ -14,8 +14,19 @@ - 可配置页面是否需要 layout。 +## 启用方式 +在 `package.json` 中引入依赖: +```json +{ + "dependencies": { + "@fesjs/fes": "^2.0.0", + "@fesjs/plugin-layout": "^2.0.0" + }, +} +``` + ## 布局类型 -配置参数是 `navigation`, 内容默认是 `side`: +配置参数是 `navigation`, 布局有三种类型 `side`、`mixin` 和 `top`, 默认是 `side`: ```js export default { layout: { @@ -36,28 +47,31 @@ export default { mixin -## 启用方式 -在 `package.json` 中引入依赖: -```json -{ - "dependencies": { - "@fesjs/fes": "^2.0.0", - "@fesjs/plugin-layout": "^2.0.0" - }, -} -``` - ### 页面禁用布局 -Fes.js 渲染路由时,如果路由元信息存在配置 `layout` 为 `false`,则表示禁用此配置,用户只需要如下配置: +布局是默认开启的,但是可能某些页面不需要展示布局样式,比如登录页面。我们只需要在页面的`.vue`中添加如下配置: ```vue - + { "layout": false } - ``` +如果只是不想展示`side`,则: + +{ + "layout": { + "side": false + } +} + +``` +`layout`的可选配置有: + +- **side**: 左侧区域 + +- **top**: 头部区域 + +- **logo**:logo和标题区域。 ## 配置 @@ -174,13 +188,13 @@ export default { - 图标使用[antv icon](https://www.antdv.com/components/icon-cn/),在这里使用组件type。 ```js { - name: "user" + icon: "user" } ``` - - 图表使用本地或者远程svg图片。 + - 图标使用本地或者远程svg图片。 ```js { - name: "/wine-outline.svg" + icon: "/wine-outline.svg" } ``` @@ -201,7 +215,7 @@ export const layout = { - **默认值**:`null` -- **详情**:布局的 Header 部位提供组件自定义功能。 +- **详情**:top的区域部分位置提供组件自定义功能。 #### unAccessHandler - **类型**:`Function` diff --git a/lerna.json b/lerna.json index 77398e55..0af0cb90 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.0-rc.29", + "version": "2.0.0", "changelog": { "repo": "WeBankFinTech/fes.js", "cacheDir": ".changelog", diff --git a/package.json b/package.json index 8402eab6..4596e5c4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "clean": "lerna clean", "bootstrap": "lerna bootstrap", "build": "father-build --watch", - "ver": "lerna version prerelease --preid rc --no-changelog --no-commit-hooks --no-private", + "ver": "lerna version patch --no-changelog --no-commit-hooks --no-private", "release": "father-build && lerna publish from-git", "docs:dev": "vuepress dev docs --clean-cache", "docs:build": "vuepress build docs --clean-cache" diff --git a/packages/create-fes-app/package.json b/packages/create-fes-app/package.json index fbc95d2a..c2ce062c 100644 --- a/packages/create-fes-app/package.json +++ b/packages/create-fes-app/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/create-fes-app", - "version": "2.0.0-rc.27", + "version": "2.0.0", "description": "create a app base on fes.js", "main": "lib/index.js", "files": [ diff --git a/packages/create-fes-app/templates/app/h5/.prettierrc b/packages/create-fes-app/templates/app/h5/.prettierrc new file mode 100644 index 00000000..29ed0c41 --- /dev/null +++ b/packages/create-fes-app/templates/app/h5/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "none" +} \ No newline at end of file diff --git a/packages/create-fes-app/templates/app/h5/package.json b/packages/create-fes-app/templates/app/h5/package.json index d0edfa08..35aefa83 100644 --- a/packages/create-fes-app/templates/app/h5/package.json +++ b/packages/create-fes-app/templates/app/h5/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/template-h5", - "version": "2.0.0-rc.0", + "version": "2.0.0", "description": "fes 移动端项目模版", "scripts": { "build": "fes build", @@ -44,9 +44,9 @@ "@ttou/postcss-px-to-viewport": "1.1.1" }, "dependencies": { - "@fesjs/fes": "^2.0.0-rc.0", - "@fesjs/plugin-icon": "^2.0.0-rc.0", - "@fesjs/plugin-request": "^2.0.0-rc.0", + "@fesjs/fes": "^2.0.0", + "@fesjs/plugin-icon": "^2.0.0", + "@fesjs/plugin-request": "^2.0.0", "vue": "^3.0.5" }, "private": true diff --git a/packages/create-fes-app/templates/app/pc/.prettierrc b/packages/create-fes-app/templates/app/pc/.prettierrc new file mode 100644 index 00000000..29ed0c41 --- /dev/null +++ b/packages/create-fes-app/templates/app/pc/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "none" +} \ No newline at end of file diff --git a/packages/create-fes-app/templates/app/pc/package.json b/packages/create-fes-app/templates/app/pc/package.json index 97432f04..4b0a3e6b 100644 --- a/packages/create-fes-app/templates/app/pc/package.json +++ b/packages/create-fes-app/templates/app/pc/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/template", - "version": "2.0.0-rc.0", + "version": "2.0.0", "description": "fes项目模版", "scripts": { "build": "fes build", @@ -46,11 +46,11 @@ "@webank/eslint-config-webank": "0.3.0" }, "dependencies": { - "@fesjs/fes": "^2.0.0-rc.0", - "@fesjs/plugin-access": "^2.0.0-rc.0", - "@fesjs/plugin-layout": "^2.0.0-rc.0", - "@fesjs/plugin-model": "^2.0.0-rc.0", - "@fesjs/plugin-enums": "^2.0.0-rc.0", + "@fesjs/fes": "^2.0.0", + "@fesjs/plugin-access": "^2.0.0", + "@fesjs/plugin-layout": "^2.0.0", + "@fesjs/plugin-model": "^2.0.0", + "@fesjs/plugin-enums": "^2.0.0", "ant-design-vue": "^2.0.0", "vue": "^3.0.5" }, diff --git a/packages/create-fes-app/templates/app/pc/yarn.lock b/packages/create-fes-app/templates/app/pc/yarn.lock index 7ab7ceb2..38650c05 100644 --- a/packages/create-fes-app/templates/app/pc/yarn.lock +++ b/packages/create-fes-app/templates/app/pc/yarn.lock @@ -1080,7 +1080,7 @@ set-value "3.0.2" tapable "^2.2.0" -"@fesjs/fes@^2.0.0-rc.0": +"@fesjs/fes@^2.0.0": version "2.0.0-rc.22" resolved "https://registry.yarnpkg.com/@fesjs/fes/-/fes-2.0.0-rc.22.tgz#dd82e6bd0abd0da90e9adf952f6e661d61faef03" integrity sha512-udoJSozlZUPCKjhdRyNj8bDcqXSve9fJzu7flFYux6ZQYUQpQP6c4NI0wPqWoZ1bcW/Ntx0slvuMOP8TEcYSxw== @@ -1091,26 +1091,26 @@ "@umijs/utils" "3.3.3" resolve-cwd "^3.0.0" -"@fesjs/plugin-access@^2.0.0-rc.0": +"@fesjs/plugin-access@^2.0.0": version "2.0.0-rc.20" resolved "https://registry.yarnpkg.com/@fesjs/plugin-access/-/plugin-access-2.0.0-rc.20.tgz#6342e3b167973d874b1e6d044dd6703b86392b73" integrity sha512-vZe68gag4zAgzpWScUA8VIFCFTFYeVnK4Duwya9USero6Zh48V6NlzocQndLODt0xReeHnc5Et7suMA6Nq9WsA== dependencies: lodash "^4.17.15" -"@fesjs/plugin-enums@^2.0.0-rc.0": +"@fesjs/plugin-enums@^2.0.0": version "2.0.0-rc.22" resolved "https://registry.yarnpkg.com/@fesjs/plugin-enums/-/plugin-enums-2.0.0-rc.22.tgz#97a5f8d309d290e28227d06e6140a6230ff9d6bd" integrity sha512-KFMcbUi87vo1eBJ8xkuoBflZID6ez9fPh4YUwNWqhMERYOOJuJ5h2331ORZIOSU903iFbBfDE/tn+XpcCXUHbQ== -"@fesjs/plugin-layout@^2.0.0-rc.0": +"@fesjs/plugin-layout@^2.0.0": version "2.0.0-rc.18" resolved "https://registry.yarnpkg.com/@fesjs/plugin-layout/-/plugin-layout-2.0.0-rc.18.tgz#f24b05b063584ac0541bdd1553128cd18e661297" integrity sha512-az7q4c+EHydabqn9Ctx2vo19ERua882fqkTgYOH15ebl+g04duDDjeWsFnCKl8AofIBuJjb98IVNqs2qvNuG8w== dependencies: "@umijs/utils" "3.3.3" -"@fesjs/plugin-model@^2.0.0-rc.0": +"@fesjs/plugin-model@^2.0.0": version "2.0.0-rc.8" resolved "https://registry.yarnpkg.com/@fesjs/plugin-model/-/plugin-model-2.0.0-rc.8.tgz#ca61e696168c5698e3630212f602c3da99ca40b4" integrity sha512-4OVDutEYOmx6GLpjxbKlXug7MJjOhDa/4FBP5M5s+MMJsy+y7VdCHLn74/ZZuWalVmx7kNRl2niJNS2EVx3vyQ== diff --git a/packages/fes-compiler/package.json b/packages/fes-compiler/package.json index 814fa1cf..3c23a36d 100644 --- a/packages/fes-compiler/package.json +++ b/packages/fes-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/compiler", - "version": "2.0.0-rc.5", + "version": "2.0.0", "description": "@fesjs/compiler", "main": "lib/index.js", "files": [ diff --git a/packages/fes-plugin-access/package.json b/packages/fes-plugin-access/package.json index bac195ae..ebf58c16 100644 --- a/packages/fes-plugin-access/package.json +++ b/packages/fes-plugin-access/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-access", - "version": "2.0.0-rc.20", + "version": "2.0.0", "description": "@fesjs/plugin-access", "main": "lib/index.js", "files": [ @@ -30,7 +30,7 @@ "lodash": "^4.17.15" }, "peerDependencies": { - "@fesjs/fes": "^2.0.0-rc.0", + "@fesjs/fes": "^2.0.0", "vue": "^3.0.5" } } diff --git a/packages/fes-plugin-enums/package.json b/packages/fes-plugin-enums/package.json index 985b787c..4babb8a7 100644 --- a/packages/fes-plugin-enums/package.json +++ b/packages/fes-plugin-enums/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-enums", - "version": "2.0.0-rc.22", + "version": "2.0.0", "description": "@fesjs/plugin-enums", "main": "lib/index.js", "files": [ @@ -27,7 +27,7 @@ "access": "public" }, "peerDependencies": { - "@fesjs/fes": "^2.0.0-rc.0", + "@fesjs/fes": "^2.0.0", "vue": "^3.0.5" } } diff --git a/packages/fes-plugin-icon/package.json b/packages/fes-plugin-icon/package.json index e567e6de..48d45139 100644 --- a/packages/fes-plugin-icon/package.json +++ b/packages/fes-plugin-icon/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-icon", - "version": "2.0.0-rc.1", + "version": "2.0.0", "description": "@fesjs/plugin-icon", "main": "lib/index.js", "files": [ diff --git a/packages/fes-plugin-jest/package.json b/packages/fes-plugin-jest/package.json index f77d0c42..8b47e896 100644 --- a/packages/fes-plugin-jest/package.json +++ b/packages/fes-plugin-jest/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-jest", - "version": "2.0.0-rc.5", + "version": "2.0.0", "description": "@fesjs/plugin-jest", "main": "lib/index.js", "files": [ @@ -31,7 +31,7 @@ }, "dependencies": { "@babel/core": "7.11.6", - "@fesjs/compiler": "^2.0.0-rc.5", + "@fesjs/compiler": "^2.0.0", "@umijs/babel-preset-umi": "3.2.24", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^26.6.3", diff --git a/packages/fes-plugin-layout/package.json b/packages/fes-plugin-layout/package.json index 91d0adee..3e106925 100644 --- a/packages/fes-plugin-layout/package.json +++ b/packages/fes-plugin-layout/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-layout", - "version": "2.0.0-rc.25", + "version": "2.0.0", "description": "@fesjs/plugin-layout", "main": "lib/index.js", "files": [ @@ -31,7 +31,7 @@ }, "peerDependencies": { "@ant-design/icons-vue": "^5.1.6", - "@fesjs/fes": "^2.0.0-rc.0", + "@fesjs/fes": "^2.0.0", "ant-design-vue": "2.0.0", "vue": "^3.0.5" } diff --git a/packages/fes-plugin-layout/src/node/helper.js b/packages/fes-plugin-layout/src/node/helper.js index a14a01e6..4c39f8f6 100644 --- a/packages/fes-plugin-layout/src/node/helper.js +++ b/packages/fes-plugin-layout/src/node/helper.js @@ -6,7 +6,7 @@ const matchName = (config, name) => { for (let i = 0; i < config.length; i++) { const item = config[i]; if (item.meta && item.meta.name === name) { - res = item.meta || {}; + res = item.meta; res.path = item.path; break; } @@ -68,10 +68,10 @@ export function getIconsFromMenu(data) { return []; } let icons = []; - (data || []).forEach((item = { path: '/' }) => { + data.forEach((item = { path: '/' }) => { if (item.icon) { const { icon } = item; - if (icon && icon.type === 'icon') { + if (icon.type === 'icon') { icons.push(icon.name); } } diff --git a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue index 9b0ef429..778302f8 100644 --- a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue +++ b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue @@ -1,6 +1,6 @@