提交 8f76ef4e 编写于 作者: V Vben

fix(form): allow the setFieldsValue method to be null or undefined close #320

上级 e6960896
......@@ -11,6 +11,7 @@
- 修复`BasicTree`下 ActionItem 的 show 属性逻辑问题
- 修复树组件 demo 示例样式错误
- 修复账号管理新增未清空旧数据
- form 组件应允许 setFieldsValue 方法值为 null 或者 undefined
## 2.0.2 (2021-03-04)
......
......@@ -59,9 +59,11 @@ export function useFormEvents({
const schema = unref(getSchema).find((item) => item.field === key);
let value = values[key];
const hasKey = Reflect.has(values, key);
value = handleInputNumberValue(schema?.component, value);
// 0| '' is allow
if (value !== undefined && value !== null && fields.includes(key)) {
if (hasKey && fields.includes(key)) {
// time type
if (itemIsDateType(key)) {
if (Array.isArray(value)) {
......
......@@ -91,7 +91,7 @@
return true;
}).filter((item) => !item.meta?.hideBreadcrumb || !item.meta?.hideMenu);
resultList = resultList.filter((item) => item.path !== PageEnum.BASE_HOME);
// resultList = resultList.filter((item) => item.path !== PageEnum.BASE_HOME);
return resultList;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册