From e32ecfe4842c3cf218dee55274bc9257a5a0f340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Thu, 1 Feb 2024 00:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=97=B6=E5=8D=95=E4=B8=AA=E5=AD=97=E6=AE=B5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mdp-ui/mixin/MdpFormMixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/mdp-ui/mixin/MdpFormMixin.js b/src/components/mdp-ui/mixin/MdpFormMixin.js index 5aafada..0c91e16 100644 --- a/src/components/mdp-ui/mixin/MdpFormMixin.js +++ b/src/components/mdp-ui/mixin/MdpFormMixin.js @@ -360,8 +360,8 @@ export const MdpFormMixin = { if(!form){ form=this.$refs['editForm']; } - form.validate((valid) => { - if (valid) { + form.validateField(fieldName,(valid) => { + if (!valid) { func(params).then(res=>{ var tips = res.data.tips; if(tips.isOk){ @@ -379,7 +379,7 @@ export const MdpFormMixin = { this.load.editSomeFields=false; }); }else{ - this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); + this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交.", type: 'error' }); } });