How to clear uploaded files by element upload component

< 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)

what result do you expect? What is the error message actually seen?

Jul.22,2021

Delete you to empty your url and not show it? this also requires background data deletion


: delete files in the on-remove callback


use
this.$refs.upload.clearFiles ();

Menu