update Table

update Table
This commit is contained in:
梁灏 2016-11-27 15:44:32 +08:00
parent 39947c1474
commit 340681ab50
4 changed files with 6 additions and 13 deletions

View file

@ -47,7 +47,6 @@
[`${this.prefixCls}-row-highlight`]: this.cloneData[index] && this.cloneData[index]._isHighlight,
[`${this.prefixCls}-row-hover`]: this.cloneData[index] && this.cloneData[index]._isHover
}
]
},
setCellWidth (column, index) {

View file

@ -57,16 +57,6 @@
selectAll () {
const status = !this.isSelectAll;
this.$parent.selectAll(status);
// let tmpData = deepCopy(this.cloneData);
// tmpData.forEach((data) => {
// data._isChecked = status;
// });
// this.cloneData = tmpData;
//
// if (status) {
// this.$parent.selectAll();
// }
}
}
}

View file

@ -179,6 +179,7 @@
this.columnsWidth = [];
let autoWidthIndex = -1;
if (allWidth) autoWidthIndex = this.cloneColumns.findIndex(cell => !cell.width);
console.log(1)
const $td = this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].querySelectorAll('td');
for (let i = 0; i < $td.length; i++) { // can not use forEach in Firefox
@ -328,6 +329,7 @@
},
columns: {
handler () {
this.cloneColumns = deepCopy(this.columns);
this.parseColumns();
this.handleResize();
},

View file

@ -74,7 +74,7 @@
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 120,
render (row, column, index) {
return `<i-button @click="edit(${index})">${row.name}</i-button>`
// return `<a>${row.name}</a>`
@ -145,6 +145,8 @@
},
ready () {
setTimeout(() => {
// this.columns[3].width = 300;
// this.columns[2].width = 150;
// return;
// this.height = 150;
// return
@ -155,7 +157,7 @@
// edit: false
// });
// this.data.splice(1, 1)
}, 1000);
}, 2000);
}
}
</script>