1、设置el-upload ref的名字
<el-upload
ref='uploadFile'
action=""
:multiple="false"
:limit="1"
:on-change="handleFileChange"
:show-file-list="false"
>
<!-- :on-success="handleSuccess" -->
<el-button>浏览</el-button>
</el-upload>
2、在mounted中加入如下代码
mounted() {
this.$refs.uploadFile.$children[0].$refs.input.webkitdirectory = true
},