@webank/fes-core
Advanced tools
Comparing version 0.1.2 to 0.1.4
{ | ||
"name": "@webank/fes-core", | ||
"version": "0.1.2", | ||
"version": "0.1.4", | ||
"description": "一个好用的前端管理台快速开发框架", | ||
@@ -10,4 +10,4 @@ "scripts": { | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/WeBankFinTech/fes.js.git" | ||
"type": "git", | ||
"url": "https://github.com/WeBankFinTech/fes.js.git" | ||
}, | ||
@@ -33,3 +33,4 @@ "license": "MIT", | ||
"@webank/fes-ui": "^0.1.0" | ||
} | ||
}, | ||
"gitHead": "11209f905e75371de1d5a5d2a5f31bc495cc0fd7" | ||
} |
@@ -11,2 +11,14 @@ import util from '../util'; | ||
const certainConfig = function (matchPages, prop, n = 1) { | ||
const length = matchPages.length; | ||
if (n > length) { | ||
return matchPages[0].components.default[prop]; | ||
} | ||
const matchPage = matchPages[length - n].components.default; | ||
if (typeof matchPage[prop] === 'boolean') { | ||
return matchPage[prop]; | ||
} | ||
return certainConfig(matchPages, prop, n + 1); | ||
}; | ||
const Page = { | ||
@@ -48,2 +60,4 @@ install(Vue, App) { | ||
created() { | ||
const defaultHeader = fesConfig.FesHeader === undefined ? false : fesConfig.FesHeader; | ||
const defaultLeft = fesConfig.FesLeft === undefined ? true : fesConfig.FesLeft; | ||
// route切换时,重新设置为初始值 | ||
@@ -54,11 +68,11 @@ const comp = (this.$route && this.$route.matched) || []; | ||
if (this.$options.__file === matchPage.__file) { | ||
const defaultHeader = fesConfig.FesHeader === undefined ? false : fesConfig.FesHeader; | ||
const defaultLeft = fesConfig.FesLeft === undefined ? true : fesConfig.FesLeft; | ||
if (typeof matchPage.FesHeader === 'boolean') { | ||
this.$root.header = matchPage.FesHeader; | ||
const header = certainConfig(comp, 'FesHeader'); | ||
if (typeof header === 'boolean') { | ||
this.$root.header = header; | ||
} else { | ||
this.$root.header = defaultHeader; | ||
} | ||
if (typeof matchPage.FesLeft === 'boolean') { | ||
this.$root.left = matchPage.FesLeft; | ||
const left = certainConfig(comp, 'FesLeft'); | ||
if (typeof left === 'boolean') { | ||
this.$root.left = left; | ||
} else { | ||
@@ -65,0 +79,0 @@ this.$root.left = defaultLeft; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76421
1734
1