mrxy-yk 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,12 +31,16 @@ function useElFormHooks(options) {
|
|
|
31
31
|
form.value = ObjectUtil.toJSON(formSnapshot);
|
|
32
32
|
formRef.value?.clearValidate();
|
|
33
33
|
}
|
|
34
|
+
function clearValidate(props) {
|
|
35
|
+
formRef.value?.clearValidate(props);
|
|
36
|
+
}
|
|
34
37
|
return {
|
|
35
38
|
ref: formRef,
|
|
36
39
|
form,
|
|
37
40
|
rules: ops.rules,
|
|
38
41
|
submit: submitHandle,
|
|
39
42
|
resetFields,
|
|
43
|
+
clearValidate,
|
|
40
44
|
_option: ops
|
|
41
45
|
};
|
|
42
46
|
}
|
|
@@ -27,7 +27,7 @@ function useElFormDialogHooks(options) {
|
|
|
27
27
|
});
|
|
28
28
|
async function show(...args) {
|
|
29
29
|
const result = await dialogHook.show(...args);
|
|
30
|
-
if (result) formHook.
|
|
30
|
+
if (result) formHook.clearValidate();
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
33
|
async function close(...args) {
|
|
@@ -49,6 +49,8 @@ export type UseFormDialogHooksExample<
|
|
|
49
49
|
submit(...args: S): void | Promise<unknown>
|
|
50
50
|
// 重置表单
|
|
51
51
|
resetFields(): void
|
|
52
|
+
// 清除表单验证
|
|
53
|
+
clearValidate(props?: Parameters<FormInstance['clearValidate']>[0]): void
|
|
52
54
|
// 展示对话框,返回是否打开成功
|
|
53
55
|
show(...args: SP): Promise<boolean>
|
|
54
56
|
// 关闭对话框,返回是否关闭成功
|
package/package.json
CHANGED