diff --git a/examples/routers/table.vue b/examples/routers/table.vue index c6cf19ea..c5bc28ee 100644 --- a/examples/routers/table.vue +++ b/examples/routers/table.vue @@ -23,9 +23,9 @@ // align: 'center' // }, { - title: '姓名', + title: '姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名', key: 'name', - width: 100, + width: 200, // sortable: true, // fixed: 'right', render: (h, params) => { @@ -46,14 +46,14 @@ title: '年龄', key: 'age', sortable: true, - width: 100 + width: 200 }, { title: '省份', key: 'province', sortable: true, // fixed: 'right', -// width: 100 + width: 200 }, // { // title: '市区', diff --git a/src/components/table/table.vue b/src/components/table/table.vue index e0d2d12a..5d06866e 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -723,9 +723,13 @@ watch: { data: { handler () { + const oldDataLen = this.rebuildData.length; this.objData = this.makeObjData(); this.rebuildData = this.makeDataWithSortAndFilter(); this.handleResize(); + if (!oldDataLen) { + this.fixedHeader(); + } // here will trigger before clickCurrentRow, so use async setTimeout(() => { this.cloneData = deepCopy(this.data);