记录
html: < li v-for=“item in items”>< img :src=“item.src” alt="" />
script : data() {
items:
[
{id:1, src:require(’…/…/assets/item2.jpg’)},
{id:2, src:require(’…/…/assets/item2.jpg’)},
{id:3, src:require(’…/…/assets/item2.jpg’)},
{id:4, src:require(’…/…/assets/item2.jpg’)},
{id:5, src:require(’…/…/assets/item2.jpg’)}
],
起初: src:’…/…/assets/item2.jpg’ 无效,请求不到;
改成 src:require(’…/…/assets/item2.jpg’
解决参考:
https://blog.csdn.net/Milan_KunderLa/article/details/80319548
https://blog.csdn.net/weishidong/article/details/78214882

Logo

前往低代码交流专区

更多推荐