This commit is contained in:
BianLzhaoMin 2025-02-26 10:42:47 +08:00
parent 5c83d09107
commit 9f4979a663
1 changed files with 8 additions and 3 deletions

View File

@ -275,9 +275,14 @@
multiple: false,
auto: true, // 禁用自动上传,点击确定按钮后上传
choose: function (obj) {
obj.reset()
// 当选择文件时会触发这个方法
obj.preview(function (index, file, result) {
console.log(file); // 打印当前选择的文件
});
var files = obj.pushFile(); // 获取文件列表
console.log(files);
},
done: function (res) {
// 上传完毕回调
@ -297,8 +302,8 @@
// 请求异常回调
console.log('文件上传失败');
}
});
});
})
})
// $('.uploadBtn').on('click', function (event) {
// event.stopPropagation(); // 阻止事件冒泡
// event.preventDefault(); // 阻止默认行为