<template> <div class="demo"> <swiper :options="swiperObj" class="swiper1"> <div class="swiper-slide" v-for="item in swiperList" :key="item.id"> {{item.title}} </div> </swiper> <swiper :options="swiperObj.thumbs.swiper" class="swiper2"> <div class="swiper-slide" v-for="item in swiperList" :key="item.id"> {{item.id}} </div> </swiper> <div class="demo-next-btn"></div> <div class="demo-prev-btn"></div> </div> </template> <script> import 'swiper/css/swiper.css' import { Swiper } from 'vue-awesome-swiper' export default { data() { return { swiperObj: { effect: 'cube', loop: 'true', autoplay: { delay: 5000, }, autoplayDisableOnInteraction: false, navigation: { nextEl: '.demo-next-btn', prevEl: '.demo-prev-btn', }, thumbs: { swiper: { el: '.products-swiper2', spaceBetween: 7, slidesPerView: 6, slideToClickedSlide: true, }, slideThumbActiveClass: 'slide-thumb-active', }, }, swiperList: [xxx], } }, components: { Swiper, }, } </script>
|