当前位置:   article > 正文

element中el-upload上传文件去掉文件列表_csdn如何去除el-upload的文件列表

csdn如何去除el-upload的文件列表

<template>
    <el-upload
        ref="upload"
        action="/api/upload"
        :limit="1"
        accept='.xlsx'
        :on-success="uploadSuccess"
        :on-error="uploadError"
    >
        <el-button size="small" type="primary">点击上传</el-button>
    </el-upload>
</template>
<script>
export default {
	methods: {
	  //文件上传事件
      uploadSuccess(res) {
        this.$refs.upload.clearFiles(); //去掉文件列表
      },
      uploadError(res){
        console.log(res);
        this.$refs.upload.clearFiles(); //去掉文件列表
      }
	}
}
</script>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/472998
推荐阅读
相关标签
  

闽ICP备14008679号