< el-col: span= "6" >
<el-upload
:ref="upload"
class="avatar-uploader"
action="xx"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-change="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
<p class="" @click="clear()">
</el-dialog>
< / el-col >
methods: {
beforeAvatarUpload(file) {
this.imageUrl = URL.createObjectURL(file.raw);
this.dialogVisible = true;
this.clearFiles()
},
clear(){
alert("ok")
this.$refs.upload.clearFiles()
vm.$refs.upload.uploadFiles.length = 0
}
}-sharp-sharp-sharp problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)