赞
踩
<el-upload
ref="uploadFile"
:show-file-list="false"
:before-upload="beforeUpload"
action="/">
<el-button :disabled="type==='edit'" class="add-button" type="primary" size="small" @click="handleAddFolder">添加</el-button>
</el-upload>
methods: {
// 点击文件夹路径上传按钮
handleAddFolder () {
this.$nextTick(() => {
this.$refs.uploadFile.$children[0].$refs.input.webkitdirectory = true
})
},
// 文件夹路径上传之前钩子函数
beforeUpload (file) {
// file.path为文件夹的路径
this.form.Folder = file.path
},
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。