mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +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'
|
className: 'ant-table-selection-column'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (columns[0] &&
|
if (columns[0] && columns[0].key === 'selection-column') {
|
||||||
columns[0].key === 'selection-column') {
|
|
||||||
columns[0] = selectionColumn;
|
columns[0] = selectionColumn;
|
||||||
} else {
|
} else {
|
||||||
columns.unshift(selectionColumn);
|
columns.unshift(selectionColumn);
|
||||||
@ -587,7 +586,7 @@ let AntTable = React.createClass({
|
|||||||
data={data}
|
data={data}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
className={classString}
|
className={classString}
|
||||||
expandIconColumnIndex={columns[0].key === 'selection-column' ? 1 : 0}
|
expandIconColumnIndex={(columns[0] && columns[0].key === 'selection-column') ? 1 : 0}
|
||||||
expandIconAsCell={expandIconAsCell} />
|
expandIconAsCell={expandIconAsCell} />
|
||||||
{emptyText}
|
{emptyText}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user