mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
export default {
|
|
props: {
|
|
theme: {
|
|
type: String,
|
|
default: null
|
|
},
|
|
themedStyle: {
|
|
type: Object,
|
|
default: null
|
|
}
|
|
},
|
|
inject: {
|
|
NThemedComponent: {
|
|
default: null
|
|
}
|
|
},
|
|
computed: {
|
|
synthesizedTheme () {
|
|
if (this.theme !== null) {
|
|
return this.theme
|
|
} else if (this.NThemedComponent && this.NThemedComponent.synthesizedTheme) {
|
|
return this.NThemedComponent.synthesizedTheme
|
|
} else {
|
|
return (this.NConfigProvider && this.NConfigProvider.synthesizedTheme) || null
|
|
}
|
|
},
|
|
synthesizedStyle () {
|
|
if (this.themedStyle && this.synthesizedTheme && this.themedStyle[this.synthesizedTheme]) {
|
|
return this.themedStyle[this.synthesizedTheme]
|
|
}
|
|
return null
|
|
},
|
|
synthesizedThemeEnvironment () {
|
|
if (this.synthesizedTheme && this.NConfigProvider && this.NConfigProvider.inheritedThemeEnvironment) {
|
|
return this.NConfigProvider.inheritedThemeEnvironment[this.synthesizedTheme] || null
|
|
}
|
|
}
|
|
}
|
|
}
|