1、后发现,直接利用<img src="../assets/imgages/1.1.jpg">可以显示图片,但是利用浏览器的F12发现,路径显示的是/static/images/1.1.jpg,于是,我将图片放在了/static/images中,使用v-for动态绑定,则显示图片。 2、另一种方法:图片依然存放在src的assets中,但是图片引入时用require引入,如图...
所以我们就需要使用v-bind动态绑定数据 每次都重新为src进行赋值 将上述html修改为 <div id="app"> <div v-for="item in list"> <img v-bind:src="item.itemImg"> //ok </div> </div> 或 <div id="app"> <div v-for="item in list"> <img :src="item.itemImg"> </div> </div> ...
解决方案1:使用common写法,即使用require写法。 imgsrc: rquire(‘@/assets/img.jpg’)解决方案2:本地开发的时候,因为域名是http://localhost:8080,也就是/,vue自动帮你转换成相对/路径。 build的时候,vue默认把图片路径指定在/下。图片地址也就是在/img/xxx.jpg。 如果项目部署在域名是http://www.aaa.com...
The vector V={2, 3, 5, 7, 11, 13, 17, 19} is used to find the target element 16 in V. The elements that have been compared with the target element in the whole process are:向量V={2, 3, 5, 7, 11, 13, 17, 19},在V中使用它查找目标元素16,整个过程中与目标元素发生过比较的...