自学内容网 自学内容网

iview upload clearFiles清除回显视图

iview upload 上传完文件之后清除内容,打开会回显视图,清除不掉

iview upload

关闭弹框时主动清除回显内容即可this.$refs.uploads.clearFiles()

<FormItem label="上传附件:" :label-width="formNameWidth">
  <Upload action="/fms/api/productDev/updateOther" ref="uploads" show-upload-list :headers="{ Authorization: getTokenFn() }">
    <Button type="primary" icon="ios-cloud-upload-outline" class="btn-upload">上传文件</Button>
  </Upload>
</FormItem>

js代码

methods: {
// 关闭弹窗
    close() {
      this.$refs.uploads.clearFiles() // 重点*******
      this.$refs['formValidate2'].resetFields()
      this.fileList = this.$cloneDeep(this.$options.data().fileList) // 初始化
      this.form2 = this.$cloneDeep(this.$options.data().form2) // 初始化
      this.modal1 = false
    }
}

原文地址:https://blog.csdn.net/qq_45094682/article/details/144242499

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!