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

Table 中不配置sorter和sortOrder 为什么无缘无故添加了一个<div title="排序">? #12613

Closed
top-soft opened this Issue Oct 12, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@top-soft

top-soft commented Oct 12, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.10.0

Environment

和环境无关

Reproduction link

https://ant.design/components/table-cn/

Steps to reproduce

我以为是自己写的问题,结果在官方API上面看到table都是那样,https://ant.design/components/table-cn/
const tableConfig = {
columns: columns,
dataSource: this.state.dataSource,
rowKey: record => record.id,
bordered: true,
loading: this.state.loading,
title: () => {
return 管理员列表;
},
pagination: this.state.pagination,
onChange: this.handleTableChange,
locale: {
filterTitle: '筛选',
filterConfirm: '确定',
filterReset: '重置',
emptyText: '暂无数据',
},
size: 'middle',
sorter:false
};
渲染的样子:
<thead className="ant-table-thead"> <tr> <th className=""> <div title="排序">登录名</div> </th> <th className=""> <div title="排序">昵称</div> </th> <th className=""> <div title="排序">状态</div> </th> <th className=""> <div title="排序">操作</div> </th> </tr> </thead>
点击这样的表头还能触发table的onChange事件!!!

What is expected?

不会新增这样一个div

What is actually happening?

<thead className="ant-table-thead"> <tr> <th className=""> <div title="排序">登录名</div> </th> <th className=""> <div title="排序">昵称</div> </th> <th className=""> <div title="排序">状态</div> </th> <th className=""> <div title="排序">操作</div> </th> </tr> </thead>

@afc163

This comment has been minimized.

Member

afc163 commented Oct 12, 2018

Fixed in f1d1d87

@afc163 afc163 closed this Oct 12, 2018

@top-soft

This comment has been minimized.

top-soft commented Oct 12, 2018

我也没有配置sortButton

@top-soft

This comment has been minimized.

top-soft commented Oct 12, 2018

@afc163 我的列不排序,我的column配置了sorter:false也是没效果,还是自动的创建这么一个div? 并且点击column还会触发onChange,这体验太差了,不排序点下还去后台发送请求!!!而且整个列的样式也要变化!

@afc163

This comment has been minimized.

Member

afc163 commented Oct 12, 2018

@top-soft Calm down.

并且点击column还会触发onChange

That was fixed in #12515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment