mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
feat(mixins/themeable): support theme
This commit is contained in:
parent
fb89fb42bf
commit
2002eb8752
17
packages/mixins/themeable.js
Normal file
17
packages/mixins/themeable.js
Normal file
@ -0,0 +1,17 @@
|
||||
export default {
|
||||
props: {
|
||||
theme: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
synthesizedTheme () {
|
||||
if (this.theme !== null) {
|
||||
return this.theme
|
||||
} else {
|
||||
return (this.NApp && this.NApp.theme) || 'default'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user