Pārlūkot izejas kodu

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

yunxing 4 gadi atpakaļ
vecāks
revīzija
093827cedc
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  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() {