vue同时校验两个表单
const rule1 = new Promise((resolve, reject) => {this.$refs['BaseInfoModel'].validate(valid => {
if (valid) {
resolve()
} else {
return false;
}
})
})
const rule2 = new Promise((resolve, reject) => {
this.$refs['BaseInfoModel2'].validate(valid => {
if (valid) {
resolve()
} else {
return false;
}
})
})
Promise.all([rule1, rule2]).then(() => {
//进行的操作
sa.ajax('/IntegralMalls/Orders/OrderDelivery', { model: self.BaseInfoModel }, function (res) {
if (res.Status) {
sa.alert(res.Message, res.Status, function () {
parent.app.f5();
sa.closeCurrIframe();
});
} else {
sa.error(res.Message, res.Status, function () {
});
}
}.bind(this));
})
源文:https://blog.csdn.net/AN0692/article/details/105528755/
以上是 vue同时校验两个表单 的全部内容, 来源链接: utcz.com/z/376040.html