实例:
实现大于三张图片时,点击箭头图片切换,并有箭头置灰不可操作。
html
<div class="summary">
<div class="gallery">
<div class="product-img">
<div @click="prevImg" class="prev-arrow" :class="{'prev-active': galleryList.length - 3 <= 0 || this.offsetCount < 1}">
<img src="../assets/images/productDetail/left.png" alt="左箭头">
</div>
<ul>
<li class="list-img">
<div class="list-img-wrap" ref="carouser">
<div @click="getCurImg(item.ImageCode, index)" v-for="(item,index) in galleryList" :key="index" class="single-img" :class="{'img-activce': item.ImageCode == curCode && imgActive}">
<img :s