refactor(layout): merge scrollContainer style and

scrollContentStyle to scrollProps
This commit is contained in:
07akioni 2020-11-14 19:05:01 +08:00
parent a5f81d15a6
commit 828c622860
2 changed files with 12 additions and 20 deletions

View File

@ -13,8 +13,7 @@
v-if="!useNativeScrollbar"
ref="scrollbar"
:theme="mergedTheme"
:content-style="scrollContentStyle"
:container-style="scrollContainerStyle"
v-bind="scrollbarProps"
>
<slot />
</n-scrollbar>
@ -56,11 +55,7 @@ export default {
type: Boolean,
default: true
},
scrollContentStyle: {
type: Object,
default: undefined
},
scrollContainerStyle: {
scrollbarProps: {
type: Object,
default: undefined
}
@ -78,12 +73,13 @@ export default {
},
computed: {
styleMarginLeft () {
if (this.NLayout && this.NLayout.hasSider) {
if (this.NLayout.siderPosition === 'absolute' && this.position === 'absolute') {
if (this.NLayout.siderCollapsed) {
return `${this.NLayout.collapsedSiderWidth}px`
const { NLayout } = this
if (NLayout && NLayout.hasSider) {
if (NLayout.siderPosition === 'absolute' && this.position === 'absolute') {
if (NLayout.siderCollapsed) {
return `${NLayout.collapsedSiderWidth}px`
} else {
return `${this.NLayout.siderWidth}px`
return `${NLayout.siderWidth}px`
}
}
}
@ -96,7 +92,8 @@ export default {
}, this.mergedStyle)
},
transitionDisabled () {
if (this.NLayout && this.NLayout.childLayoutTransitionDisabled) {
const { NLayout } = this
if (NLayout && NLayout.childLayoutTransitionDisabled) {
return true
} else {
return false

View File

@ -20,8 +20,7 @@
ref="scrollbar"
class="n-layout-sider__content"
:theme="mergedTheme"
:content-style="scrollContentStyle"
:container-style="scrollContainerStyle"
v-bind="scrollbarProps"
>
<slot />
</n-scrollbar>
@ -112,11 +111,7 @@ export default {
type: Number,
default: 300
},
scrollContentStyle: {
type: Object,
default: undefined
},
scrollContainerStyle: {
scrollbarProps: {
type: Object,
default: undefined
},