update Table
update Table
This commit is contained in:
parent
39947c1474
commit
340681ab50
4 changed files with 6 additions and 13 deletions
|
@ -47,7 +47,6 @@
|
||||||
[`${this.prefixCls}-row-highlight`]: this.cloneData[index] && this.cloneData[index]._isHighlight,
|
[`${this.prefixCls}-row-highlight`]: this.cloneData[index] && this.cloneData[index]._isHighlight,
|
||||||
[`${this.prefixCls}-row-hover`]: this.cloneData[index] && this.cloneData[index]._isHover
|
[`${this.prefixCls}-row-hover`]: this.cloneData[index] && this.cloneData[index]._isHover
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
setCellWidth (column, index) {
|
setCellWidth (column, index) {
|
||||||
|
|
|
@ -57,16 +57,6 @@
|
||||||
selectAll () {
|
selectAll () {
|
||||||
const status = !this.isSelectAll;
|
const status = !this.isSelectAll;
|
||||||
this.$parent.selectAll(status);
|
this.$parent.selectAll(status);
|
||||||
|
|
||||||
// let tmpData = deepCopy(this.cloneData);
|
|
||||||
// tmpData.forEach((data) => {
|
|
||||||
// data._isChecked = status;
|
|
||||||
// });
|
|
||||||
// this.cloneData = tmpData;
|
|
||||||
//
|
|
||||||
// if (status) {
|
|
||||||
// this.$parent.selectAll();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,7 @@
|
||||||
this.columnsWidth = [];
|
this.columnsWidth = [];
|
||||||
let autoWidthIndex = -1;
|
let autoWidthIndex = -1;
|
||||||
if (allWidth) autoWidthIndex = this.cloneColumns.findIndex(cell => !cell.width);
|
if (allWidth) autoWidthIndex = this.cloneColumns.findIndex(cell => !cell.width);
|
||||||
|
console.log(1)
|
||||||
|
|
||||||
const $td = this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].querySelectorAll('td');
|
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
|
for (let i = 0; i < $td.length; i++) { // can not use forEach in Firefox
|
||||||
|
@ -328,6 +329,7 @@
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
handler () {
|
handler () {
|
||||||
|
this.cloneColumns = deepCopy(this.columns);
|
||||||
this.parseColumns();
|
this.parseColumns();
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
},
|
},
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 200,
|
width: 120,
|
||||||
render (row, column, index) {
|
render (row, column, index) {
|
||||||
return `<i-button @click="edit(${index})">${row.name}</i-button>`
|
return `<i-button @click="edit(${index})">${row.name}</i-button>`
|
||||||
// return `<a>${row.name}</a>`
|
// return `<a>${row.name}</a>`
|
||||||
|
@ -145,6 +145,8 @@
|
||||||
},
|
},
|
||||||
ready () {
|
ready () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// this.columns[3].width = 300;
|
||||||
|
// this.columns[2].width = 150;
|
||||||
// return;
|
// return;
|
||||||
// this.height = 150;
|
// this.height = 150;
|
||||||
// return
|
// return
|
||||||
|
@ -155,7 +157,7 @@
|
||||||
// edit: false
|
// edit: false
|
||||||
// });
|
// });
|
||||||
// this.data.splice(1, 1)
|
// this.data.splice(1, 1)
|
||||||
}, 1000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Add table
Reference in a new issue