Commit a677710a authored by 王康's avatar 王康

form

parent bc5a9237
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
class="upload-demo" class="upload-demo"
action="/api/upload" action="/api/upload"
:on-remove="handleRemove" :on-remove="handleRemove"
multiple multiple :file-list="fileList"
:on-exceed="handleExceed"> :on-exceed="handleExceed">
<el-button slot="trigger" size="small" type="primary" <el-button slot="trigger" size="small" type="primary"
:disabled="column.disabled">选取文件</el-button> :disabled="column.disabled">选取文件</el-button>
...@@ -335,7 +335,9 @@ ...@@ -335,7 +335,9 @@
picker.$emit('pick', date) picker.$emit('pick', date)
} }
}] }]
} },
fileList: []
} }
}, },
created() { created() {
...@@ -345,6 +347,18 @@ ...@@ -345,6 +347,18 @@
// console.log(this.buttons) // console.log(this.buttons)
}, },
methods: { methods: {
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleExceed(files, fileList) {
console.log(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
beforeRemove(file, fileList) {
console.log(this.$confirm(`确定移除$ { file.name } ?`))
},
// inputChange(val) { // inputChange(val) {
// // console.log(event) // // console.log(event)
// // console.log(val) // // console.log(val)
...@@ -382,12 +396,6 @@ ...@@ -382,12 +396,6 @@
onEditorReady(val) { onEditorReady(val) {
// console.log('editor ready!') // console.log('editor ready!')
}, },
handleRemove(file, fileList) {
console.log(file, fileList)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
// 判断是否一个对象的所有属性都为空 // 判断是否一个对象的所有属性都为空
isEmpty(obj) { isEmpty(obj) {
_.forEach(obj, function(val) { _.forEach(obj, function(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment