当前位置:网站首页>How to empty uploaded attachments with components encapsulated by El upload

How to empty uploaded attachments with components encapsulated by El upload

2022-07-05 09:29:00 Left hand holding * * right hand

Upload an attachment in the recent project , Clear the list when clicking cancel . Because its attachment upload component has been deleted , The Cancel button does not call the interface . But using component attributes will report errors
, So let him refresh some parts :
 Insert picture description here

 <div class="file-info bdr10"
                   v-if="isRouterAlive">
                <!-- 1====== Homework after class             -->
                <upload-file-flex ref="upload"
                                  v-model="ruleForm.annex"
                                  @getFileList="getFileList"
                                  :accept="'.docx,.pdf'"
                                  :limit="1"></upload-file-flex>
              </div>
              <div class="text-center"
                   style="margin-top:10px">
                <el-button round
                           @click="removeFile"
                           size="mini"> Cancel </el-button>
                <el-button type="primary"
                           size="mini"
                           :ldstatus="ldstatus"
                           style="background: #056AFF;"
                           @click="subMit"
                           round> preservation </el-button>
              </div>
export default {
  name: "app",
  data() {
    return {
      isRouterAlive: true,
    };
  },
  provide() {
    return {
       removeFile: this.removeFile,
    };
  },
  methods: {
   removeFile () {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.ruleForm.annex = ''
        this.isRouterAlive = true;
      });
    },
  },
};

原网站

版权声明
本文为[Left hand holding * * right hand]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050926398795.html