|
|
@@ -789,8 +789,9 @@ export default {
|
|
789
|
789
|
},
|
|
790
|
790
|
},
|
|
791
|
791
|
methods: {
|
|
792
|
|
- handleRemove(file, fileList) {},
|
|
793
|
|
- handlePreview(file) {},
|
|
|
792
|
+ handleRemove(file, fileList) {console.log('文件列表移除文件时的钩子');},
|
|
|
793
|
+ handlePreview(file) {console.log('点击文件列表中已上传的文件时的钩子');},
|
|
|
794
|
+ // 文件超出个数限制时的钩子
|
|
794
|
795
|
handleExceed(files, fileList) {
|
|
795
|
796
|
this.$message.warning(
|
|
796
|
797
|
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
@@ -798,6 +799,7 @@ export default {
|
|
798
|
799
|
} 个文件`
|
|
799
|
800
|
);
|
|
800
|
801
|
},
|
|
|
802
|
+ // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。
|
|
801
|
803
|
beforeRemove(file, fileList) {
|
|
802
|
804
|
return this.$confirm(`确定移除 ${file.name}?`);
|
|
803
|
805
|
},
|