Open
Description
Version
Vben Admin V5
Describe the bug?
使用演示站点 系统管理 菜单管理即可复现
菜单管理 激活路径 验证规则为 zod 字符串 可空
如果什么都不输入 表单验证可通过
如果输入后 再全部删除 表单验证不通过
同理 有初始值 全部删除 表单验证不通过
第二个问题
当数据为嵌套类型的 如
{menu:{
xxx...
meta: {
xxx...
activePath: ...
}
}} 时
如果字段的验证规则为 zod 字符串 但是不能为空 也就是去掉optional()
则表单无法回填 也就是form.setValues()方法不能设置该字段
Reproduction
https://www.vben.pro/#/system/menu
System Info
...
Relevant log output
Validations
- Read the docs
- Ensure the code is up to date. (Some issues have been fixed in the latest version)
- I have searched the existing issues and checked that my issue does not duplicate any existing issues.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.