baidu / baidu/amis

CRUD组件新增数据后获取id问题

Open
#8,563 0 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

CRUD组件新增一列数据后,在数据列表中使用switch组件更新数据的状态,获取到的id是上一列数据的id值。

新增一列数据成功后,不手动刷新数据列表,在数据列表页直接点击新增数据的switch状态按钮,获取到的是上一列数据的id值,没有获取到最新的
![image](https://github.com/baidu/amis/assets/139934218/9462ae27-658a-4c46-a010-831d2b94417a)
![image](https://github.com/baidu/amis/assets/139934218/a2ff5ec5-894a-4902-a5e1-72273e8a95f8)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in the CRUD component: add a row, then click that row's switch without manually refreshing the data list. Trace how the newly added row is represented and how the switch obtains its id. Done means the switch uses the new row's id immediately after creation and preserves existing row updates.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.