From 366486658b00a9d4137b03ccde835ba46931d8ea Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Sun, 17 Apr 2022 09:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DvalidateForm=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/form-render/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/form-render/index.vue b/src/components/form-render/index.vue index 07800c8..40136a2 100644 --- a/src/components/form-render/index.vue +++ b/src/components/form-render/index.vue @@ -548,14 +548,14 @@ this.$refs.renderForm.clearValidate(props) }, - /* 验证表单,通过返回true,不通过返回false */ - validateForm() { - let result = null + /** + * 校验表单 + * @param callback 回调函数 + */ + validateForm(callback) { this.$refs['renderForm'].validate((valid) => { - result = valid + callback(valid) }) - - return result }, validateFields() {