update Table #167

update Table
This commit is contained in:
梁灏 2017-01-05 14:10:08 +08:00
parent 3d6fa54b39
commit a404bbaed3
3 changed files with 11 additions and 3 deletions

View file

@ -1,5 +1,5 @@
<template>
<table cellspacing="0" cellpadding="0" border="0" :style="style">
<table cellspacing="0" cellpadding="0" border="0" :style="styles">
<colgroup>
<col v-for="column in columns" :width="setCellWidth(column, $index, true)">
</colgroup>
@ -75,6 +75,12 @@
}
},
computed: {
styles () {
const style = Object.assign({}, this.style);
const width = this.$parent.bodyHeight === 0 ? parseInt(this.style.width) : parseInt(this.style.width) + this.$parent.scrollBarWidth;
style.width = `${width}px`;
return style;
},
isSelectAll () {
let isSelectAll = true;
if (!this.data.length) isSelectAll = false;