Update PreviewTable.vue

This commit is contained in:
xhacker-zzz 2021-12-22 10:49:25 +08:00 committed by GitHub
parent df69649721
commit 2ba4831d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,8 @@
<el-table-column label="封面">
<template slot-scope="scope">
<el-upload :auto-upload="false" :show-file-list="true" :on-change="chageCover" action="" drag>
<img :src="scope.row.picture" style="width: 100px; height: 100px">
<img v-if="imageUrl" width="100px" height="100px" :src="imageUrl" />
<img v-else :src="scope.row.picture" style="width: 100px; height: 100px">
<div slot="error" class="image-slot el-image__error">暂无封面</div>
</img>
</el-upload>
@ -58,6 +59,7 @@ export default {
this.$emit('download', row);
},
changeCover(file) {
imageUrl=file.url;
},
},
};