Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default rowkey value of the table component should be index for each row #37708

Closed
ANS-HD opened this issue Sep 22, 2022 · 2 comments
Closed

Comments

@ANS-HD
Copy link

ANS-HD commented Sep 22, 2022

What problem does this feature solve?

table中的rowkey如果没有设置应该设置为每一行的index下标,table在接受后端返回的数据时候,有可能没有值唯一的字段,这就导致了rowkey无法取值的现象

What does the proposed API look like?

rowKey={(r,i)=>i.toString()}

@afc163
Copy link
Member

afc163 commented Sep 23, 2022

Table 列表数据需要唯一的 key,否则不应该用 Table 来展现。如果服务端未返回可以自行前端加上 index,但还是建议和后端讨论一下,数据不可能没主键的。

@afc163 afc163 closed this as completed Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants