Parcourir la source

fixbug: 修复项目概览,预览大图,横屏下点击x号关闭之后,主页面轮播位置错乱的bug

yunxing il y a 4 ans
Parent
commit
093827cedc
1 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 7 2
      src/views/overview/index.vue

+ 7 - 2
src/views/overview/index.vue

@@ -237,9 +237,14 @@ export default {
         showImgPreview(newV, oldV) {
             if (newV !== oldV && !newV) {
                 this.autoplay = 3000
-                // 预览大图切换横竖屏之后,主页面轮播图,位置错乱,重新resize恢复位置
-                this.$refs.mSwipe.resize()
             }
+            // 预览大图切换横竖屏之后,主页面轮播图,位置错乱,重新resize恢复位置
+            this.$refs.mSwipe.resize()
+            this.$nextTick(() => {
+                setTimeout(() => {
+                    this.$refs.mSwipe.resize()
+                }, 1000)
+            })
         },
     },
     created() {