export async function getImgUrl(uuid) {
let path = await getImage(uuid)
return path
}
async function getImage(uuid){
let img= await getUuidImage(uuid)
return img;
}
<el-table-column label="参赛人照片" align="center">
<template slot-scope="scope">
<img :src="getImageUrl(scope.row.headImg)" width="155px" height="100px"/>
</template>
</el-table-column>
getImageUrl (uuid) {
return getImgUrl(uuid).then(res => {return res})
},
请问return 返回没拿到值
你return的是一个promise对象,当然没法绑定到src上。可以这样改:
getImageUrl (uuid) {
getImgUrl(uuid).then(res => {this.x=res;);
if (this.x===undefined){
}
return this.x;
}