关于elemen-plus/elemen-ui Carousel走马灯图片不显示的问题
<el-carousel height="250px"> <el-carousel-item v-for="item in carouselList" :key="item"> <img :src="item.path" /> </el-carousel-item> </el-carousel>
const carouselList = reactive([ { path: require('../../static/img/1.jpg') }, { path: require('../../static/img/2.jpg') }, { path: require('../../static/img/3.jpg') } ])
使用图片时需要require引入,直接写图片路径不生效