From 68b308ee837b8f9e0a7ab7d8a8bfdecba8bada2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Fri, 14 Jul 2017 14:52:54 +0800 Subject: [PATCH] fixex #1353 --- examples/routers/table.vue | 180 +++++++++++++++++++--------- src/components/table/table-body.vue | 5 +- src/components/table/table-head.vue | 2 +- src/components/table/table.vue | 11 +- 4 files changed, 138 insertions(+), 60 deletions(-) diff --git a/examples/routers/table.vue b/examples/routers/table.vue index 2639c9a8..5e471454 100644 --- a/examples/routers/table.vue +++ b/examples/routers/table.vue @@ -1,57 +1,29 @@ + \ No newline at end of file diff --git a/src/components/table/table-body.vue b/src/components/table/table-body.vue index a374624c..efb81834 100644 --- a/src/components/table/table-body.vue +++ b/src/components/table/table-body.vue @@ -7,6 +7,7 @@ diff --git a/src/components/table/table-head.vue b/src/components/table/table-head.vue index aa1d69c5..563e1d7a 100644 --- a/src/components/table/table-head.vue +++ b/src/components/table/table-head.vue @@ -26,7 +26,7 @@
- {{ item.label }} + {{ item.label }}
diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 5e8cc1d5..40259411 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -44,7 +44,7 @@ :styleObject="fixedTableStyle" :columns="leftFixedColumns" :obj-data="objData" - :columns-width.sync="columnsWidth" + :columns-width="columnsWidth" :data="rebuildData">
@@ -95,6 +95,9 @@ const prefixCls = 'ivu-table'; + let rowKey = 1; + let columnKey = 1; + export default { name: 'Table', mixins: [ Locale ], @@ -562,7 +565,10 @@ }, makeData () { let data = deepCopy(this.data); - data.forEach((row, index) => row._index = index); + data.forEach((row, index) => { + row._index = index; + row._rowKey = rowKey++; + }); return data; }, makeDataWithSort () { @@ -629,6 +635,7 @@ columns.forEach((column, index) => { column._index = index; + column._columnKey = columnKey++; column._width = column.width ? column.width : ''; // update in handleResize() column._sortType = 'normal'; column._filterVisible = false;