核心提示:引入vue-awesome-swiperimport swiper/dist/css/swiper.css;import { swiper, swiperSlide } from vue-awesom...
引入vue-awesome-swiper
import 'swiper/dist/css/swiper.css'; import { swiper, swiperSlide } from 'vue-awesome-swiper'; components: { swiper, swiperSlide, }, data() { return { swiperOption: { width: window.innerWidth, zoom : true, initialSlide: 0, }, }; }, <swiper :options="swiperOption" ref="imgOverview" style="height: 100%;"> <swiper-slide v-for="(img, index) in previewImg"> <p class="swiper-zoom-container"> <img :src="img" alt=""> </p> </swiper-slide> </swiper>