提交 3d168a73 编写于 作者: fxy060608's avatar fxy060608

feat(h5): add --window-margin

上级 34ab6a53
...@@ -200,12 +200,16 @@ export default { ...@@ -200,12 +200,16 @@ export default {
} else { } else {
updateCssVar('--window-right', '0px') updateCssVar('--window-right', '0px')
} }
},
marginWidth (newVal) {
updateCssVar('--window-margin', newVal + 'px')
} }
}, },
beforeCreate () { beforeCreate () {
updateCssVar('--top-window-height', '0px') updateCssVar('--top-window-height', '0px')
updateCssVar('--window-left', '0px') updateCssVar('--window-left', '0px')
updateCssVar('--window-right', '0px') updateCssVar('--window-right', '0px')
updateCssVar('--window-margin', '0px')
}, },
created () { created () {
this.topWindow = Vue.component('VUniTopWindow') this.topWindow = Vue.component('VUniTopWindow')
...@@ -281,7 +285,7 @@ export default { ...@@ -281,7 +285,7 @@ export default {
} }
this.$emit('maxWidth', showMaxWidth) this.$emit('maxWidth', showMaxWidth)
if (!this.$containerElem) { if (!this.$containerElem) {
this.$containerElem = document.querySelector('uni-content,uni-app') this.$containerElem = document.querySelector('uni-app')
} }
if (!this.$containerElem) { if (!this.$containerElem) {
return return
...@@ -424,8 +428,8 @@ export default { ...@@ -424,8 +428,8 @@ export default {
.uni-top-window { .uni-top-window {
position: fixed; position: fixed;
left: 0; left: var(--window-margin);
right: 0; right: var(--window-margin);
top: 0; top: 0;
z-index: 998; z-index: 998;
overflow: hidden; overflow: hidden;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册