提交 12b41ff1 编写于 作者: fxy060608's avatar fxy060608

refactor: layout.vue

上级 c7df63ea
......@@ -14,6 +14,7 @@
>
<v-uni-top-window
ref="top"
v-bind="bindWindow"
@hook:mounted="onTopWindowInit"
/>
</div>
......@@ -32,7 +33,8 @@
v-if="leftWindow"
v-show="showLeftWindow || apiShowLeftWindow"
ref="leftWindow"
:data-show="apiShowLeftWindow"
v-bind="bindWindow"
:data-show="apiShowLeftWindow"
:style="leftWindowStyle"
>
<div
......@@ -51,7 +53,8 @@
v-if="rightWindow"
v-show="showRightWindow || apiShowRightWindow"
ref="rightWindow"
:data-show="apiShowRightWindow"
v-bind="bindWindow"
:data-show="apiShowRightWindow"
:style="rightWindowStyle"
>
<div
......@@ -143,6 +146,16 @@ export default {
}
},
computed: {
bindWindow () {
return {
matchTopWindow: this.topWindowMediaQuery,
showTopWindow: this.showTopWindow || this.apiShowTopWindow,
matchLeftWindow: this.leftWindowMediaQuery,
showLeftWindow: this.showLeftWindow || this.apiShowLeftWindow,
matchRightWindow: this.rightWindowMediaQuery,
showRightWindow: this.showRightWindow || this.apiShowRightWindow
}
},
showLayout () {
return this.showTopWindow || this.showLeftWindow || this.showRightWindow
},
......@@ -213,7 +226,7 @@ export default {
}
},
methods: {
resetApiShowWindow () {
resetApiShowWindow () {
// 仅对 left,right 重置
// this.apiShowTopWindow = false
this.apiShowLeftWindow = false
......@@ -247,7 +260,7 @@ export default {
if (windowOptions && windowOptions.matchMedia && hasOwn(windowOptions.matchMedia, 'minWidth')) {
this[minWidthName] = windowOptions.matchMedia.minWidth
}
if (!this.minWidth || this.minWidth > this[minWidthName]) {
if (typeof this.minWidth === 'undefined' || this.minWidth > this[minWidthName]) {
this.minWidth = this[minWidthName]
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册