Skip to content

Commit

Permalink
fix(form): fix out of memory error (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Apr 16, 2023
1 parent d14c866 commit 483819c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/form/src/sf.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy {
Object.keys(schema.properties!).forEach(key => {
const uiKey = `$${key}`;
const property = retrieveSchema(schema.properties![key] as SFSchema, definitions);
const curUi = deepCopy({
const curUi = {
...(property.ui as SFUISchemaItem),
...uiSchema[uiKey]
});
const ui = deepCopy({
};
const ui = {
...this._defUi,
...parentUiSchema,
// 忽略部分会引起呈现的属性
Expand All @@ -341,7 +341,7 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy {
? { widget: 'select' }
: null),
...curUi
} as SFUISchemaItemRun) as SFUISchemaItemRun;
} as SFUISchemaItemRun;
// 继承父节点布局属性
if (isHorizontal) {
if (parentUiSchema.spanLabelFixed) {
Expand Down
2 changes: 2 additions & 0 deletions packages/util/other/deep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export function deepGet(obj: NzSafeAny, path: string | string[] | null | undefin
* Base on [extend](https://github.com/justmoon/node-extend) deep copy.
*
* 基于 [extend](https://github.com/justmoon/node-extend) 的深度拷贝
*
* NOTE: Don't a lot of recursion, maybe performance issues
*/
export function deepCopy<T extends { [key: string]: NzSafeAny } = NzSafeAny>(obj: T | null | undefined): T {
const result = extend(true, {}, { _: obj });
Expand Down

0 comments on commit 483819c

Please sign in to comment.