修改颜色轮播图改变

This commit is contained in:
2026-08-24 15:56:48 +08:00
parent b190fba0f3
commit 566b2cc4e0
2 changed files with 55 additions and 7 deletions
@@ -5,6 +5,7 @@
class="swiper"
:circular="true"
:indicator-dots="false"
:current="current"
@change="onChange"
>
<swiper-item v-for="(item, index) in images" :key="index">
@@ -40,6 +41,12 @@ export default {
current: 0
}
},
watch: {
images() {
// 切换图片数组时重置指示点到第一张
this.current = 0
}
},
methods: {
onChange(e) {
this.current = e.detail.current