upload.render({
elem: '按钮id',
url: '接口',
acceptMime: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
exts: 'xlsx|xls',
before: function () {
this.data = {
//传到后台的数值--要写在这个地方,不然无法获取到值
}
},
done: function (res) {
//如果上传失败
if (res.code >= 0) {
//return layer.msg(res.msg);
}
},
error: function () {
layer.msg('上传时发生错误!');
},
});