From 76ae3e8853e64dc64d138f665b389a1ba4962035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 9 Apr 2019 08:58:29 +0800 Subject: [PATCH] fix #5380 --- src/components/table/table-body.vue | 8 ++++++-- src/components/table/table.vue | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/table/table-body.vue b/src/components/table/table-body.vue index 4dfd9846..e2f7ab0e 100644 --- a/src/components/table/table-body.vue +++ b/src/components/table/table-body.vue @@ -8,7 +8,7 @@ - + @@ -63,6 +63,10 @@ draggable: { type: Boolean, default: false + }, + rowKey: { + type: Boolean, + default: false } }, computed: { diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 9df50532..81c4a29b 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -21,6 +21,7 @@ :styleObject="tableStyle" :columns="cloneColumns" :data="rebuildData" + :row-key="rowKey" :columns-width="columnsWidth" :obj-data="objData"> @@ -59,6 +60,7 @@ :styleObject="fixedTableStyle" :columns="leftFixedColumns" :data="rebuildData" + :row-key="rowKey" :columns-width="columnsWidth" :obj-data="objData"> @@ -84,6 +86,7 @@ :styleObject="fixedRightTableStyle" :columns="rightFixedColumns" :data="rebuildData" + :row-key="rowKey" :columns-width="columnsWidth" :obj-data="objData"> @@ -200,6 +203,11 @@ return oneOf(value, ['dark', 'light']); }, default: 'dark' + }, + // #5380 开启后,:key 强制更新,否则使用 index + rowKey: { + type: Boolean, + default: false } }, data () {