@peng_kai/kit 0.2.10 → 0.2.11
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.
|
@@ -82,20 +82,7 @@ function useAntdForm<S extends Record<string, unknown>, TS = S>(schemas: MaybeRe
|
|
|
82
82
|
|
|
83
83
|
watch(itemProps, () => $form.clearValidate?.(), { flush: 'post', deep: true });
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
// const _state: any = {};
|
|
87
|
-
|
|
88
|
-
// for (const k in schemasR.value) {
|
|
89
|
-
// const item = schemasR.value[k];
|
|
90
|
-
// _state[k] = (k in state.value) ? toRef(state.value, k) : toRef(item, 'value');
|
|
91
|
-
// }
|
|
92
|
-
|
|
93
|
-
// console.log('🤡 / _state:', _state);
|
|
94
|
-
// state.value = _state;
|
|
95
|
-
// });
|
|
96
|
-
|
|
97
|
-
// 为什么之前用 watchEffect?
|
|
98
|
-
watch(schemasR, () => {
|
|
85
|
+
watchEffect(() => {
|
|
99
86
|
const _state: any = {};
|
|
100
87
|
|
|
101
88
|
for (const k in schemasR.value) {
|
|
@@ -104,7 +91,19 @@ function useAntdForm<S extends Record<string, unknown>, TS = S>(schemas: MaybeRe
|
|
|
104
91
|
}
|
|
105
92
|
|
|
106
93
|
state.value = _state;
|
|
107
|
-
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// 为什么之前用 watchEffect?
|
|
97
|
+
// watch(schemasR, () => {
|
|
98
|
+
// const _state: any = {};
|
|
99
|
+
|
|
100
|
+
// for (const k in schemasR.value) {
|
|
101
|
+
// const item = schemasR.value[k];
|
|
102
|
+
// _state[k] = (k in state.value) ? toRef(state.value, k) : toRef(item, 'value');
|
|
103
|
+
// }
|
|
104
|
+
|
|
105
|
+
// state.value = _state;
|
|
106
|
+
// }, { immediate: true });
|
|
108
107
|
|
|
109
108
|
return reactive({ state, stateTF, show, props, itemProps, $form });
|
|
110
109
|
}
|