<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>
正常图片 3c6407b6d501410eabd8e156b2393fb1.jpg
vue二次编码图片 3c6407b6d501410eabd8e156b2393fb1.d8a2cb66.jpg
代码大致如下
<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 ? '/img/' + scope.row.img19 : ''"
></el-image>
</div>
</template>
</el-table-column>
把img文件夹通过nginx发布出来发布,然后通过url访问(http://你的系统端口/img/图片名.jpg)
location /img/ {
alias html/dist/static/img/;
autoindex on;
}
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
webpack或其他对图片文件做了二次编码,js对应的地址代码也会跟着修改
方法
1.去掉打包的二次编码
2.找到编译后的代码并改掉
3.服务器图片文件加上二次编码的部分
4.url使用服务器地址