mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
Fix columns[0] undefined bug in Table
This commit is contained in:
parent
8070e05de1
commit
9b09e54df5
@ -374,8 +374,7 @@ let AntTable = React.createClass({
|
||||
className: 'ant-table-selection-column'
|
||||
};
|
||||
}
|
||||
if (columns[0] &&
|
||||
columns[0].key === 'selection-column') {
|
||||
if (columns[0] && columns[0].key === 'selection-column') {
|
||||
columns[0] = selectionColumn;
|
||||
} else {
|
||||
columns.unshift(selectionColumn);
|
||||
@ -587,7 +586,7 @@ let AntTable = React.createClass({
|
||||
data={data}
|
||||
columns={columns}
|
||||
className={classString}
|
||||
expandIconColumnIndex={columns[0].key === 'selection-column' ? 1 : 0}
|
||||
expandIconColumnIndex={(columns[0] && columns[0].key === 'selection-column') ? 1 : 0}
|
||||
expandIconAsCell={expandIconAsCell} />
|
||||
{emptyText}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user