Table: not throw error when calling toggleExpansion (#16304)

pull/17161/head
Inside 2019-08-22 19:50:42 +08:00 committed by hetech
parent fc822fe810
commit 625b4e9262
1 changed files with 2 additions and 2 deletions

View File

@ -166,8 +166,8 @@ export default {
const { rowKey, treeData } = this.states; const { rowKey, treeData } = this.states;
const id = getRowIdentity(row, rowKey); const id = getRowIdentity(row, rowKey);
const data = id && treeData[id]; const data = id && treeData[id];
const oldExpanded = treeData[id].expanded; if (id && data && ('expanded' in data)) {
if (id && data && 'expanded' in data) { const oldExpanded = data.expanded;
expanded = typeof expanded === 'undefined' ? !data.expanded : expanded; expanded = typeof expanded === 'undefined' ? !data.expanded : expanded;
treeData[id].expanded = expanded; treeData[id].expanded = expanded;
if (oldExpanded !== expanded) { if (oldExpanded !== expanded) {