el-upload图片回显
核心内容
给el-upload的file-list列表传递{url: 图片地址}
即可。
html
<el-button @click="backShow(imgUrl)">回显</el-button>
<el-upload
...
:file-list="uploadImageList"
...
>
</el-upload>
js
data(){
return {
uploadImageList: [],
}
}
methods: {
backShow(imgUrl){
this.uploadImageList.splice(0, 1, {url: imgUrl})
}
}