本来常规回显这样就好了,返回一个静态资源地址,img绑定url地址就好了,如果后端直接返回图片应该怎么回显示呢?
<el-upload v-model:file-list="fileList">
const fileList = ref<UploadUserFile[]>([
{
name: 'food.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
},
{
name: 'plant-1.png',
url: '/images/plant-1.png',
},
])
FileReader 或者 URL.createObjectURL,也可以考虑转成base64.
可参考:https://segmentfault.com/a/11...