Skip to content

Commit

Permalink
fix(form): fix inheriting references to other of ui (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jun 7, 2023
1 parent 3779e0a commit a0150e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/form/src/sf.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy {
if (!Array.isArray(schema.required)) schema.required = [];

Object.keys(schema.properties!).forEach(key => {
const uiKey = `$${key}`;
const uiKeyPrefix = '$';
const uiKey = uiKeyPrefix + key;
const property = retrieveSchema(schema.properties![key] as SFSchema, definitions);
const curUi = {
...(property.ui as SFUISchemaItem),
Expand All @@ -342,6 +343,9 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy {
: null),
...curUi
} as SFUISchemaItemRun;
Object.keys(ui)
.filter(key => key.startsWith(uiKeyPrefix))
.forEach(key => delete ui[key]);
// 继承父节点布局属性
if (isHorizontal) {
if (parentUiSchema.spanLabelFixed) {
Expand Down

0 comments on commit a0150e7

Please sign in to comment.