Merge pull request #125 from xiudaozhe/master

fix: 🐛 修复关闭弹窗时没有clearValidate问题
This commit is contained in:
Ray Hao
2024-05-31 12:00:34 +08:00
committed by GitHub

View File

@@ -100,7 +100,8 @@
:prop="item.prop" :prop="item.prop"
:formData="formData" :formData="formData"
:attrs="item.attrs" :attrs="item.attrs"
></slot> >
</slot>
</template> </template>
</el-form-item> </el-form-item>
</template> </template>
@@ -224,7 +225,8 @@
:prop="item.prop" :prop="item.prop"
:formData="formData" :formData="formData"
:attrs="item.attrs" :attrs="item.attrs"
></slot> >
</slot>
</template> </template>
</el-form-item> </el-form-item>
</template> </template>
@@ -251,7 +253,7 @@ import type {
DrawerProps, DrawerProps,
} from "element-plus"; } from "element-plus";
import { useThrottleFn } from "@vueuse/core"; import { useThrottleFn } from "@vueuse/core";
import { reactive, ref, watch, watchEffect } from "vue"; import { reactive, ref, watch, watchEffect, nextTick } from "vue";
// 对象类型 // 对象类型
export type IObject = Record<string, any>; export type IObject = Record<string, any>;
@@ -398,7 +400,9 @@ const handleSubmit = useThrottleFn(() => {
function handleCloseModal() { function handleCloseModal() {
modalVisible.value = false; modalVisible.value = false;
formRef.value?.resetFields(); formRef.value?.resetFields();
formRef.value?.clearValidate(); nextTick(() => {
formRef.value?.clearValidate();
});
} }
// 显示modal // 显示modal
function setModalVisible(data: IObject = {}) { function setModalVisible(data: IObject = {}) {