element ui 上传文件组件,可以选中文件夹并上传文件夹内所有文件
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
<template>
<el-upload
class="upload-demo"
action="#"
:on-remove="fileRemoveHandle4"
:on-change="fileChangeHandle4"
accept=""
:auto-upload="false"
multiple
:file-list="form.instFilePics"
ref="uploadFile">
<el-button size="small" type="primary" :title="form.instFile.length == 0 || !form.instFile ? '请先上传Md文件' : ''">
<i class="el-icon-folder-opened"></i>
</el-button>
</el-upload>
</template>
<script>
export default {
name: "uploadFile",
data(){
return {
form:{
instFilePics:[],
instFile:[]
}
}
},
mounted() {
this.$refs.uploadFile.$children[0].$refs.input.webkitdirectory = true;
},
methods:{
// 使用说明文档 路径
fileChangeHandle4(file, fileList, name) {
this.form.instFilePics = fileList
},
// 使用说明文档 路径
fileRemoveHandle4(file, fileList, name) {
// if (file.id) {
// this.instFilePics.push(file.id);
// }
this.form.instFilePics = fileList
},
}
}
</script>
<style scoped>
</style>
GitHub 加速计划 / eleme / element
10
1
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:4 个月前 )
c345bb45
8 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 8 个月前
更多推荐
已为社区贡献4条内容
所有评论(0)