Skip to content

Commit

Permalink
fix(Form): 修复表单组件 id 与 dataKey 不一致导致报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
D-xuanmo committed Jul 10, 2023
1 parent e0c13dd commit 77dd9df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dl-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xuanmo/dl-common",
"version": "0.0.2-beta.12",
"version": "0.0.2-beta.13",
"author": {
"name": "xuanmo",
"email": "me@xuanmo.xin"
Expand Down
2 changes: 1 addition & 1 deletion packages/dl-common/src/form/demo/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const FORM_MODEL: Partial<IFormModelItem>[] = [
},
{
id: 'gridItem1',
dataKey: 'gridItem1',
dataKey: 'gridItemKey',
component: 'DInput',
label: 'item1',
value: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/dl-common/src/form/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class FormStore {
* 获取单个 item 信息
* @param id
*/
public getItem = (id: string) => this.models.get(this.dataKeyMap.get(id)!)
public getItem = (id: string) => this.models.get(this.dataKeyMap.get(id) || id)

/**
*
Expand Down

0 comments on commit 77dd9df

Please sign in to comment.