feat(layout): themed-style

This commit is contained in:
07akioni 2020-05-30 13:51:20 +08:00
parent 1b08fe1bfe
commit 3f9a052c7b

View File

@ -7,10 +7,7 @@
[`n-${syntheticTheme}-theme`]: syntheticTheme,
[`n-layout--${siderCollapseMode}-collapse-mode`]: siderCollapseMode
}"
:style="{
marginLeft: styleMarginLeft,
transition: transitionDisabled ? 'none' : null
}"
:style="syntheticStyle"
>
<n-scrollbar
v-if="!useNativeScrollbar"
@ -54,6 +51,10 @@ export default {
scrollContainerStyle: {
type: Object,
default: null
},
themedStyle: {
type: Object,
default: null
}
},
data () {
@ -80,6 +81,13 @@ export default {
}
return null
},
syntheticStyle () {
const themedStyle = this.themedStyle
return Object.assign({
marginLeft: this.styleMarginLeft,
transition: this.transitionDisabled ? 'none' : null
}, themedStyle ? themedStyle[this.syntheticTheme] : null)
},
transitionDisabled () {
if (this.NLayout && this.NLayout.childLayoutTransitionDisabled) {
return true