Vue动态加载图片图片不显示

图片是放在assets文件夹下的

使用require进行解决

图片不显示的原因

在webpack,将图片放在assets中,会将图片图片来当做模块来用,因为是动态加载的,所以url-loader将无法解析图片地址,

<el-table-column label="照片">
        <template slot-scope="scope">
          <i class="el-icon-picture-outline" @click="showPhoto(scope.row)"></i>
          <img id="aa" :src="scope.row.img" />
        </template>
</el-table-column>
 {
          date: "2016-05-02",studentId: "201319981010"require("../../../assets/image/wearther.png"),//引号中括号里面哦
          address: "区金沙江路 1518 弄"
        },

 

 

 

相关文章

https://segmentfault.com/a/1190000022018995 https://www....
ES6 (ECMAScript 6)中的模块是一个包含 JavaScript 代码的...
from https://mp.weixin.qq.com/s/-rc1lYYlsfx-wR4mQmIIQQ V...
D:\Temp&gt;npm init vite@latest vue3study --temp...
文章浏览阅读1.2k次。最近自己从零撸起的甘特图组件需要子组...
文章浏览阅读3.3k次,点赞3次,收藏16次。静默打印是什么?简...