Commit c1115edd1afe43f10fbf8fe08428f84485956f63

Authored by huanghong
1 parent 408b6950

fixed table

examples/routers/table.vue
@@ -12,10 +12,10 @@ @@ -12,10 +12,10 @@
12 <Table :height='200' border :columns="columns2" :data="data3"></Table> 12 <Table :height='200' border :columns="columns2" :data="data3"></Table>
13 </div> 13 </div>
14 <div style='margin:20px 0px'> 14 <div style='margin:20px 0px'>
15 - <Table :width='500' border :columns="columns2" :data="data3"></Table> 15 + <Table :width='600' border :columns="columns2" :data="data3"></Table>
16 </div> 16 </div>
17 <div style='margin:20px 0px'> 17 <div style='margin:20px 0px'>
18 - <Table :width='500' :height='200' border :columns="columns2" :data="data3"></Table> 18 + <Table :width='600' :height='200' border :columns="columns2" :data="data3"></Table>
19 </div> 19 </div>
20 <div style='margin:20px 0px;'> 20 <div style='margin:20px 0px;'>
21 Table scrolling <i-switch v-model="fixedHeader" style="margin-right: 5px"></i-switch> 21 Table scrolling <i-switch v-model="fixedHeader" style="margin-right: 5px"></i-switch>
src/components/table/mixin.js
@@ -32,8 +32,8 @@ export default { @@ -32,8 +32,8 @@ export default {
32 } 32 }
33 // when fixed type,reset first right fixed column's width 33 // when fixed type,reset first right fixed column's width
34 if (this.fixed === 'right' && top ) { 34 if (this.fixed === 'right' && top ) {
35 - const firstFixedIndex = this.columns.findIndex((col) => col.fixed === 'right');  
36 - if (firstFixedIndex === index) { 35 + //const firstFixedIndex = this.columns.findIndex((col) => col.fixed === 'right');
  36 + if (this.columns.length === index + 1) {
37 let scrollBarWidth = this.$parent.scrollBarWidth; 37 let scrollBarWidth = this.$parent.scrollBarWidth;
38 if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0; 38 if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0;
39 width += scrollBarWidth; 39 width += scrollBarWidth;