mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
feat(layout): themed-style
This commit is contained in:
parent
1b08fe1bfe
commit
3f9a052c7b
@ -7,10 +7,7 @@
|
|||||||
[`n-${syntheticTheme}-theme`]: syntheticTheme,
|
[`n-${syntheticTheme}-theme`]: syntheticTheme,
|
||||||
[`n-layout--${siderCollapseMode}-collapse-mode`]: siderCollapseMode
|
[`n-layout--${siderCollapseMode}-collapse-mode`]: siderCollapseMode
|
||||||
}"
|
}"
|
||||||
:style="{
|
:style="syntheticStyle"
|
||||||
marginLeft: styleMarginLeft,
|
|
||||||
transition: transitionDisabled ? 'none' : null
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<n-scrollbar
|
<n-scrollbar
|
||||||
v-if="!useNativeScrollbar"
|
v-if="!useNativeScrollbar"
|
||||||
@ -54,6 +51,10 @@ export default {
|
|||||||
scrollContainerStyle: {
|
scrollContainerStyle: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
themedStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@ -80,6 +81,13 @@ export default {
|
|||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
|
syntheticStyle () {
|
||||||
|
const themedStyle = this.themedStyle
|
||||||
|
return Object.assign({
|
||||||
|
marginLeft: this.styleMarginLeft,
|
||||||
|
transition: this.transitionDisabled ? 'none' : null
|
||||||
|
}, themedStyle ? themedStyle[this.syntheticTheme] : null)
|
||||||
|
},
|
||||||
transitionDisabled () {
|
transitionDisabled () {
|
||||||
if (this.NLayout && this.NLayout.childLayoutTransitionDisabled) {
|
if (this.NLayout && this.NLayout.childLayoutTransitionDisabled) {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user