Browse Source

修复swiper底部序号不重置的问题

zhangxike 1 week ago
parent
commit
dd197f3815
2 changed files with 5 additions and 5 deletions
  1. 2 2
      pages/work/download/PhotoRecord.uvue
  2. 3 3
      pages/work/record/RecordList.uvue

+ 2 - 2
pages/work/download/PhotoRecord.uvue

@@ -54,7 +54,7 @@
 
 			</view>
 			<view class="my-page">
-				<swiper class="swiper-box my-swiper" :current="0" :indicator-dots="true" v-if="item.photourlSpl.length>0">
+				<swiper class="swiper-box my-swiper" :current="0" :indicator-dots="true" v-if="item.photourlSpl.length>0" :key="'photo-'+item.sxid">
 					<swiper-item v-for="(url, index) in item.photourlSpl" :key="index" @tap="preview(uni.env.USER_DATA_PATH+url)">
 						<view class="swiper-item ">
 							<image class="my-image" :src="uni.env.USER_DATA_PATH+url" mode="aspectFill" />
@@ -66,7 +66,7 @@
 				</swiper>
 
 				<swiper class="swiper-box my-swiper mg-top" :current="0" :indicator-dots="true"
-					v-if="item.exampleurlSpl.length>0">
+					v-if="item.exampleurlSpl.length>0" :key="'example-'+item.sxid">
 					<swiper-item v-for="(url, index) in item.exampleurlSpl" :key="index" @tap="preview(url)">
 						<view class="swiper-item ">
 							<image class="my-image" :src="url" mode="aspectFill" />

+ 3 - 3
pages/work/record/RecordList.uvue

@@ -67,7 +67,7 @@
 
 			</view>
 			<view class="my-page">
-				<swiper class="swiper-box my-swiper" :current="0" :indicator-dots="true" v-if="item.urlpdt.length>0">
+				<swiper class="swiper-box my-swiper" :current="0" :indicator-dots="true" v-if="item.urlpdt.length>0" :key="'photo-'+item.sxid">
 					<swiper-item v-for="(url, index) in item.urlpdt" :key="index" @tap="preview(uni.env.USER_DATA_PATH+url)">
 						<view class="swiper-item ">
 							<image class="my-image" :src="uni.env.USER_DATA_PATH+url" mode="aspectFill" />
@@ -79,8 +79,8 @@
 				</swiper>
 
 				<swiper class="swiper-box my-swiper mg-top" :current="0" :indicator-dots="true"
-					v-if="item.urlspl.length>0">
-					<swiper-item v-for="(url, index) in item.urlspl" :key="index" @tap="preview(url)">
+					v-if="item.urlspl.length>0" :key="'example-'+item.sxid">
+					<swiper-item v-for="(url, index) in item.urlspl" :key="index" @tap="preview(url)" >
 						<view class="swiper-item ">
 							<image class="my-image" :src="url" mode="aspectFill" />
 						</view>