import { Overlay } from 'vant';
Vue.use(Overlay);
在data 里面
overlayShow :false , //遮道层不显示
save(){
if (this.itemName == "" || this.itemName.match(/^s*$/) ){ // 输入内容不可以为空以及不能为空格
Toast.fail('每条项目不能为空');
return;
};
this.overlayShow = true ; /*开始出现遮道层*/
api
.addEquipmentMould({
mouldName: this.mouldName,
})
.then((res) => {
if (res.code == 200) {
this.overlayShow = false ; /*遮道层消失*/
Toast.success('新建模板成功');
this.$router.push({
name: 'models_mac',
})
} else {
Toast.fail(res.message);
this.overlayShow = false ; ///*遮道层消失*/
}
});
},