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

This commit is contained in:
Vben 2021-03-04 23:52:49 +08:00
parent e696089660
commit 8f76ef4e70
3 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@
- 修复`BasicTree`下 ActionItem 的 show 属性逻辑问题
- 修复树组件 demo 示例样式错误
- 修复账号管理新增未清空旧数据
- form 组件应允许 setFieldsValue 方法值为 null 或者 undefined
## 2.0.2 (2021-03-04)

View File

@ -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)) {

View File

@ -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;
}