bash
<el-upload
drag
action
multiple
:file-list="fileList"
:on-remove="handleRemove"
:auto-upload="false"
:on-change="handleChange"
:beforeUpload="beforeAvatarUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__text">只能上传 xlsx 格式的文件</div>
</el-upload>
因为配置了auto-upload为false,所以beforeUpload没有执行
可以用on-change来进行校验