fixed table

This commit is contained in:
huanghong 2018-03-21 16:23:17 +08:00
parent 408b695046
commit c1115edd1a
2 changed files with 4 additions and 4 deletions

View file

@ -12,10 +12,10 @@
<Table :height='200' border :columns="columns2" :data="data3"></Table>
</div>
<div style='margin:20px 0px'>
<Table :width='500' border :columns="columns2" :data="data3"></Table>
<Table :width='600' border :columns="columns2" :data="data3"></Table>
</div>
<div style='margin:20px 0px'>
<Table :width='500' :height='200' border :columns="columns2" :data="data3"></Table>
<Table :width='600' :height='200' border :columns="columns2" :data="data3"></Table>
</div>
<div style='margin:20px 0px;'>
Table scrolling <i-switch v-model="fixedHeader" style="margin-right: 5px"></i-switch>

View file

@ -32,8 +32,8 @@ export default {
}
// when fixed type,reset first right fixed column's width
if (this.fixed === 'right' && top ) {
const firstFixedIndex = this.columns.findIndex((col) => col.fixed === 'right');
if (firstFixedIndex === index) {
//const firstFixedIndex = this.columns.findIndex((col) => col.fixed === 'right');
if (this.columns.length === index + 1) {
let scrollBarWidth = this.$parent.scrollBarWidth;
if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
width += scrollBarWidth;