vue遍历数组获取图片src显示不了的问题解决
轮播图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...
·
轮播图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')
}]
更多推荐
已为社区贡献1条内容
所有评论(0)