//loading
Vue.prototype.openLoading = function () {
const loading = this.$loading({
lock: true,
text: '正在加载...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
setTimeout(function () {
loading.close();
}, 5000)
return loading;
}
//用法
const loading = this.openLoading();
loading.close();
//实例
submitApprove(form) {
var flag = this.isDateRepeat();
if (flag == false) return false;
this.$refs[form].validate((valid) => {
if (valid) {
const loading = this.openLoading();
tbAreaOrderAdd(this.form).then((res) => {
if (res.data.code == 0) {
this.$message({
message: "提交成功",
type: "success",
});
this.$refs[form].resetFields();
this.getAddrList();
loading.close();
}
});
}
});
},