From 248b1a7ecc7b101fbadb15f7f7bd98b54a528d14 Mon Sep 17 00:00:00 2001 From: andm31 Date: Fri, 31 May 2024 11:56:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8D=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=BC=B9=E7=AA=97=E6=97=B6=E6=B2=A1=E6=9C=89clearVali?= =?UTF-8?q?date=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PageModal/index.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/PageModal/index.vue b/src/components/PageModal/index.vue index 473a6ea8..9d4ccc4d 100644 --- a/src/components/PageModal/index.vue +++ b/src/components/PageModal/index.vue @@ -100,7 +100,8 @@ :prop="item.prop" :formData="formData" :attrs="item.attrs" - > + > + @@ -224,7 +225,8 @@ :prop="item.prop" :formData="formData" :attrs="item.attrs" - > + > + @@ -251,7 +253,7 @@ import type { DrawerProps, } from "element-plus"; import { useThrottleFn } from "@vueuse/core"; -import { reactive, ref, watch, watchEffect } from "vue"; +import { reactive, ref, watch, watchEffect, nextTick } from "vue"; // 对象类型 export type IObject = Record; @@ -398,7 +400,9 @@ const handleSubmit = useThrottleFn(() => { function handleCloseModal() { modalVisible.value = false; formRef.value?.resetFields(); - formRef.value?.clearValidate(); + nextTick(() => { + formRef.value?.clearValidate(); + }); } // 显示modal function setModalVisible(data: IObject = {}) {