请问为什么最后的图片路径请求了两次,第一次404,第二次有返回http路径
控制台都是404 找不到图片
<el-table-column prop="qrCode" label="二维码" align="center">
<template slot-scope="scope">
<img :src="scope.row.qrCode"
style="width:50px;height:50px;"
@click.stop="zoomPicture"/>
</template>
</el-table-column>
import { getImgUrl } from '@/utils/tool'
list (data) {
data.forEach((ele,i) => {
if(ele.qrCode != '' && ele.qrCode != null){
getImgUrl(ele.qrCode).then(res=>{
ele.qrCode = res
console.log(res)
})
}
});
this.elderList = data
},
公共组件有getImgUrl这个方法
写在行内的么? 刚开始渲染dom时候找不到 请求回来才找到 做个三元运算