- vue+springboot项目
- 图片文件存储的位置是D:\nginx-1.24.0\html\dist\img,可以理解为我的nginx服务器地址,只不过是本地的

- 图片进行存储后是以原名称存储的,不存在vue进行的二次命名。
- vue项目调用图片显示的代码,背景:数据表格内的图片展示
<el-table-column width="160vh" prop="img19" label="发货图片19" >
<template #default="scope">
<div style="width: auto ;height: auto;display: flex;align-items: center;">
<el-image
fit="fill"
:src="scope.row.img19?require(`/public/img/${scope.row.img19}`):''"
></el-image>
</div>
</template>
</el-table-column>
- 上文代码所展示的图片只能使用vue打包后的二次编码图片,普通的未二次编码的文件不会显示
正常图片 3c6407b6d501410eabd8e156b2393fb1.jpg
vue二次编码图片 3c6407b6d501410eabd8e156b2393fb1.d8a2cb66.jpg
- 综上所述,我的问题就是无法在页面动态添加图片并显示,只能使用项目打包好的图片。