fixed a Table bug

This commit is contained in:
梁灏 2017-07-19 16:34:52 +08:00
parent 9a0757e343
commit 119eeafede
2 changed files with 8 additions and 4 deletions

View file

@ -23,9 +23,9 @@
// align: 'center' // align: 'center'
// }, // },
{ {
title: '姓名', title: '姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名',
key: 'name', key: 'name',
width: 100, width: 200,
// sortable: true, // sortable: true,
// fixed: 'right', // fixed: 'right',
render: (h, params) => { render: (h, params) => {
@ -46,14 +46,14 @@
title: '年龄', title: '年龄',
key: 'age', key: 'age',
sortable: true, sortable: true,
width: 100 width: 200
}, },
{ {
title: '省份', title: '省份',
key: 'province', key: 'province',
sortable: true, sortable: true,
// fixed: 'right', // fixed: 'right',
// width: 100 width: 200
}, },
// { // {
// title: '', // title: '',

View file

@ -723,9 +723,13 @@
watch: { watch: {
data: { data: {
handler () { handler () {
const oldDataLen = this.rebuildData.length;
this.objData = this.makeObjData(); this.objData = this.makeObjData();
this.rebuildData = this.makeDataWithSortAndFilter(); this.rebuildData = this.makeDataWithSortAndFilter();
this.handleResize(); this.handleResize();
if (!oldDataLen) {
this.fixedHeader();
}
// here will trigger before clickCurrentRow, so use async // here will trigger before clickCurrentRow, so use async
setTimeout(() => { setTimeout(() => {
this.cloneData = deepCopy(this.data); this.cloneData = deepCopy(this.data);