Skip to content

Commit

Permalink
fix:(editableTable)点击保存后valueType未读取到导致convertMoment的日期格式错误 (#8878)
Browse files Browse the repository at this point in the history
Co-authored-by: echoyl <[email protected]>
  • Loading branch information
echoyl and echoyl authored Nov 26, 2024
1 parent 53e5cc7 commit b3f1574
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/form/src/BaseForm/BaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,13 @@ function BaseFormComponents<T = Record<string, any>, U = Record<string, any>>(
if (!nameList) throw new Error('nameList is require');
const value = getFormInstance()?.getFieldValue(nameList!);
const obj = nameList ? set({}, nameList as string[], value) : value;
return get(transformKey(obj, omitNil, nameList), nameList as string[]);
//transformKey会将keys重新和nameList拼接,所以这里要将nameList的首个元素弹出
const newNameList = [...nameList];
newNameList.shift();
return get(
transformKey(obj, omitNil, newNameList),
nameList as string[],
);
},
/**
* 获取被 ProForm 格式化后的单个数据, 包含他的 name
Expand Down

0 comments on commit b3f1574

Please sign in to comment.