1.template模板中写入img标签
<!-- base64图片 -->
<img :src="formLabelAlign.deptPic" />
2.methods中写入事件
cargoinfo.examineshow({ id: row.id }).then((response) => {
if (response.status == 200) {
this.formLabelAlign = response.data;
this.formLabelAlign.deptPic = `data:image/png;base64,${response.data.deptPic}`;
}
});
3.调后端接口
// 下载预览
function examineshow(params) {
return request({
url: `/epidemic/examine/show`,
method: 'get',
params
})
}