Skip to content

Commit 7df7d78

Browse files
candy-Tongcandychuang
andauthored
fix: useForm ruleRef undefined warning #4881 (#4882), close #4881
Co-authored-by: candychuang <[email protected]>
1 parent 8dfe7ee commit 7df7d78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/form/useForm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Ref } from 'vue';
2-
import { reactive, watch, nextTick, unref, shallowRef, toRaw } from 'vue';
2+
import { reactive, watch, nextTick, unref, shallowRef, toRaw, ref } from 'vue';
33
import cloneDeep from 'lodash-es/cloneDeep';
44
import intersection from 'lodash-es/intersection';
55
import isEqual from 'lodash-es/isEqual';
@@ -92,7 +92,7 @@ function getPropByPath(obj: Props, path: string, strict: boolean) {
9292

9393
function useForm(
9494
modelRef: Props | Ref<Props>,
95-
rulesRef?: Props | Ref<Props>,
95+
rulesRef: Props | Ref<Props> = ref({}),
9696
options?: {
9797
immediate?: boolean;
9898
deep?: boolean;

0 commit comments

Comments
 (0)