2019-09-17 19:29:27 +08:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
theme: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
2019-11-22 13:21:32 +08:00
|
|
|
},
|
|
|
|
themedStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
2019-09-17 19:29:27 +08:00
|
|
|
}
|
|
|
|
},
|
2019-11-26 18:16:50 +08:00
|
|
|
inject: {
|
|
|
|
NThemedComponent: {
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2019-09-17 19:29:27 +08:00
|
|
|
computed: {
|
|
|
|
synthesizedTheme () {
|
|
|
|
if (this.theme !== null) {
|
|
|
|
return this.theme
|
2019-11-26 18:16:50 +08:00
|
|
|
} else if (this.NThemedComponent && this.NThemedComponent.synthesizedTheme) {
|
|
|
|
return this.NThemedComponent.synthesizedTheme
|
2019-09-17 19:29:27 +08:00
|
|
|
} else {
|
2019-11-28 16:17:21 +08:00
|
|
|
return (this.NConfigProvider && this.NConfigProvider.synthesizedTheme) || null
|
2019-09-17 19:29:27 +08:00
|
|
|
}
|
2019-11-22 13:21:32 +08:00
|
|
|
},
|
|
|
|
synthesizedStyle () {
|
|
|
|
if (this.themedStyle && this.synthesizedTheme && this.themedStyle[this.synthesizedTheme]) {
|
|
|
|
return this.themedStyle[this.synthesizedTheme]
|
|
|
|
}
|
|
|
|
return null
|
2019-11-28 16:17:21 +08:00
|
|
|
},
|
|
|
|
synthesizedThemeEnvironment () {
|
2019-12-10 22:44:51 +08:00
|
|
|
if (this.synthesizedTheme && this.NConfigProvider && this.NConfigProvider.inheritedThemeEnvironment) {
|
|
|
|
return this.NConfigProvider.inheritedThemeEnvironment[this.synthesizedTheme] || null
|
2019-11-28 16:17:21 +08:00
|
|
|
}
|
2019-09-17 19:29:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|