From 107ba565a6eed82d41f6c20713fe1c3b88aea84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=80=E7=8F=A0?= Date: Wed, 14 Mar 2018 17:33:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20switch=20transfrom?= =?UTF-8?q?=20=E6=89=80=E5=BC=95=E8=B5=B7=E7=9A=84=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E6=94=B9=E5=8F=98=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/x-dialog/index.vue | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/components/x-dialog/index.vue b/src/components/x-dialog/index.vue index 6dfbcc745..2efc14e99 100755 --- a/src/components/x-dialog/index.vue +++ b/src/components/x-dialog/index.vue @@ -3,10 +3,10 @@ class="vux-x-dialog" :class="{'vux-x-dialog-absolute': layout === 'VIEW_BOX'}"> -
+
-
+
@@ -65,6 +65,7 @@ export default { } }, mounted () { + this.dialogShow = this.show if (typeof window !== 'undefined') { if (window.VUX_CONFIG && window.VUX_CONFIG.$layout === 'VIEW_BOX') { this.layout = 'VIEW_BOX' @@ -73,13 +74,16 @@ export default { }, watch: { show (val) { - this.$emit('update:show', val) - this.$emit(val ? 'on-show' : 'on-hide') - if (val) { - this.addModalClassName() - } else { - this.removeModalClassName() - } + setTimeout(() => { + this.dialogShow = val + this.$emit('update:show', val) + this.$emit(val ? 'on-show' : 'on-hide') + if (val) { + this.addModalClassName() + } else { + this.removeModalClassName() + } + }, 200) } }, methods: { @@ -101,7 +105,8 @@ export default { }, data () { return { - layout: '' + layout: '', + dialogShow: '' } } }