el-upload 手动上传文件
2021-03-08 18:30
标签:操作 handle 显示文件 for time dia display 转化 div el-upload 手动上传文件 标签:操作 handle 显示文件 for time dia display 转化 div 原文地址:https://www.cnblogs.com/moguzi12345/p/12870657.html//选择文件并显示文件名/文件大小/状态 等
handleChange(file, fileList) {
this.oploadfileList = [];
let size = file.size;
if(size
//上传文件
submitUpload(file, fileList) {
this.$refs.upload.submit();
},
//文件上传成功后
onSuccess(response, file, fileList) {
// console.log(file)
// console.log(response)
this.uploadBtnIcon = ‘el-icon-upload2‘;
this.btnText = ‘数据导入‘;
if (response.code === 0) {
let _this=this; // 定义预存变量
setTimeout(function(){
_this.$message({
message: ‘批量操作成功‘,
type: ‘success‘
});
_this.dialogVisible2 = false;
},3000);
} else {
this.$message({
message: response.message,
type: ‘error‘
})
}
this.orderInfos()
},