shaogen1995 il y a 3 ans
Parent
commit
902b0602f0
1 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 7 7
      hot/src/views/Home.vue

+ 7 - 7
hot/src/views/Home.vue

@@ -36,27 +36,27 @@
         ref="mySwiper"
         :options="swiperOptions"
       >
-        <swiper-slide v-for="i in data[active]" :key="i">
+        <swiper-slide v-for="(item,index) in data[active]" :key="index">
           <div class="slide">
-            <viewer v-if="active === 'images'" ref="viewer" :images="lookPics">
+            <viewer v-if="active === 'images'" ref="viewer" :images="lookPics" >
               <img
                 style="cursor: pointer"
-                v-lazy="imgSrc(i)"
+                v-lazy="imgSrc(item)"
                 alt=""
-                @click="lookImg(imgSrc(i),i-1)"
+                @click="lookImg(imgSrc(item),index)"
               />
             </viewer>
 
             <video
               v-else-if="active === 'video'"
-              :src="fixUrl(i.url)"
+              :src="fixUrl(item.url)"
               controls
               autoplay
             ></video>
             <iframe
-              @click="colseParent(i)"
+              @click="colseParent(item)"
               v-else-if="active === 'model' || active === 'iframe'"
-              :src="fixUrl(i)"
+              :src="fixUrl(item)"
               frameborder="0"
             ></iframe>
           </div>