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

Column 中的key设置了好像没用 #642

Closed
dagouzhi opened this issue Dec 7, 2015 · 2 comments
Closed

Column 中的key设置了好像没用 #642

dagouzhi opened this issue Dec 7, 2015 · 2 comments

Comments

@dagouzhi
Copy link

dagouzhi commented Dec 7, 2015

http://ant.design/components/table/#column 中的key为什么设置没有用呢? 现在我的数据中有一个id我有两个td中共同调用到,谢谢 我用的是 0.10.4

const columns = [{
    title: 'ID',
    dataIndex: 'id'
},
{
    title: '操作',
    dataIndex: 'id',
    key: 'test',
    render: function (id) {
        return  <Link  to={`/edit/${id}`}>
                  编辑
                </Link>
    }
}]
afc163 added a commit that referenced this issue Dec 7, 2015
@afc163
Copy link
Member

afc163 commented Dec 7, 2015

确实有问题,在 0.11.0 分支中修复。

楼主可以不指定 dataIndex 来解决:

const columns = [{
    title: 'ID',
    dataIndex: 'id'
},
{
    title: '操作',
    render: function (value, record) {
        return  <Link  to={`/edit/${record.id}`}>
          编辑
        </Link>
    }
}]

@lock
Copy link

lock bot commented May 6, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants