`toTypedSchema` 在根模式为 `ZodObject` 时,会将嵌套对象字段初始化为 `{field: undefined}`,而不是 `undefined`,但在 `ZodEffects` 时则不会这样做
作者: howiezhao创建于 2026年5月7日更新于 2026年5月7日
当使用 `useForm` 与 `toTypedSchema` 时,在 `initialValues` 中不存在的嵌套对象字段会根据根模式是普通 `ZodObject` 还是 `ZodEffects` (通过 `.refine()` / `.superRefine()` 生成) 而初始化不同。
内容来源: logaretm/vee-validate