vue中动态引入图片数组,图片显示不出来
imgArray: [
'../../assets/banner.jpg',
'../../assets/banner01.jpg',
'../../assets/banner02.jpg'
]
解决方法:引入后再放到数组中使用
import bn from '../../assets/banner.jpg'; import bn1 from '../../assets/banner01.jpg'; import bn2 from '../../assets/banner02.png';
data(){ return{ imgArry:[ bn, bn1, bn2 ] } }