轮播图HTML:
<swiper-slide v-for="item of swiperList" :key="item.id">
    <img class="swiper-img" :src="item.imgUrl" />
</swiper-slide>

vue中data部分使用require解决:

swiperList: [{
    id: '001',
    imgUrl: require('../../../assets/imgs/banner/banner_0.jpg')
}, {
    id: '002',
    imgUrl: require('../../../assets/imgs/banner/banner_1.jpg')
}, {
    id: '003',
    imgUrl: require('../../../assets/imgs/banner/banner_2.jpg')
}]

 

Logo

前往低代码交流专区

更多推荐