alibaba / alibaba/formily-editor

DEMO 中导出数据跟实际编辑的进度不一致

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
172
Forks
28
PR merge metrics
No merged PRs in 30d

Description

我在查看 readme 中的 demo地址: https://codesandbox.io/s/formlily-schema-editor-vb0ch?file=/index.js 的时候,发现:

在表单编辑器中修改部分属性或者新增组件,这个时候点击导出数据和保存数据,发现两者弹出来的输出格式对不上,点击保存取到的数据为最新的编辑状态数据,而导出则不是。

点击导出数据如下:
```js
{
"x-component-props": {
"size": "medium",
"labelAlign": "left",
"wrapperCol": 12,
"labelTextAlign": "right",
"labelCol": 7
},
"type": "object",
"properties": {
"xx": {
"type": "string",
"x-component": "input",
"x-component-props": {
"addonTextBefore": "",
"trim": true,
"hasClear": true,
"placeholder": "",
"addonTextAfter": ""
},
"title": "xx",
"x-index": 0,
"key": "xx"
}
}
}
```

点击保存的格式如下:
```js
{
"x-component-props": {
"size": "medium",
"labelAlign": "left",
"labelTextAlign": "right",
"labelCol": 7,
"wrapperCol": 12
},
"type": "object",
"properties": {
"3333": {
"x-component": "switch",
"type": "boolean",
"key": "3333",
"x-index": 0,
"x-component-props": {}
},
"xx": {
"key": "xx",
"type": "string",
"x-component": "input",
"x-component-props": {
"addonTextBefore": "",
"trim": true,
"hasClear": true,
"placeholder": "",
"addonTextAfter": ""
},
"title": "xx",
"x-index": 1
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the mismatch using the README demo at the provided CodeSandbox URL, starting with index.js. Compare the handlers or state sources used by export and save after editing a field or adding a component. Done means both actions return the latest edited schema with matching content.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.