Commit 625b4e92 authored by Inside's avatar Inside Committed by hetech

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

parent fc822fe8
...@@ -166,8 +166,8 @@ export default { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment