From 836de9f9606129fc73619b85609298a9d7975982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Sun, 28 Jun 2020 11:28:06 +0800 Subject: [PATCH] Table no longer modifies the _showChildren field --- src/components/table/table.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/table/table.vue b/src/components/table/table.vue index f584f252..e483c06f 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -837,7 +837,8 @@ this.$nextTick(() => { const newData = this.getDataByRowKey(rowKey); newData._isShowChildren = !newData._isShowChildren; - this.updateDataStatus(rowKey, '_showChildren', newData._isShowChildren); + // 由于 updateDataStatus 是基于原数据修改,导致单选、多选等状态重置,所以暂不处理 _showChildren 状态,而是通过事件 @on-expand-tree + // this.updateDataStatus(rowKey, '_showChildren', newData._isShowChildren); }); } }); @@ -845,7 +846,8 @@ } data._isShowChildren = !data._isShowChildren; - this.updateDataStatus(rowKey, '_showChildren', data._isShowChildren); + // 由于 updateDataStatus 是基于原数据修改,导致单选、多选等状态重置,所以暂不处理 _showChildren 状态,而是通过事件 @on-expand-tree + // this.updateDataStatus(rowKey, '_showChildren', data._isShowChildren); this.$emit('on-expand-tree', rowKey, data._isShowChildren); }, /**