先大概了解一下这个组件的属性和方法:
action:看官网就知道了,指定上传的路径,但是一般vue项目里我们的请求路径不会写在这里。
show-file-list:是否显示你上传的文件,true的话它会在一个ul里显示
before-upload:顾名思义,上传之前的一些操作,我把校验写在这里了。
注意::auto-upload="false"时before-upload不生效,所以她两选择一个便好。
beforeUpload(file) {
const Xls = file.name.split('.'