Commit e7f2801b5eff0200074e5fe144bc2d3d16f9af7f
Committed by
GitHub
1 parent
41102077
fix last column resize bug when no data
If a table has heigth and last column is auto width let width = '' // is_last_column, true && top_always_true && height_set_by_user, true if ( this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) { // width will be 0 + this.$parent.scrollBarWidth === this.$parent.scrollBarWidth // so last column will be 10~20px(the width of scrollBar) } there is an example with iview@2.8.0 [gist](https://gist.github.com/anonymous/e04e86c9e99d4d1e97bf327769acd345) [demo on jsbin](http://jsbin.com/soqogagiqu)
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/components/table/mixin.js
@@ -25,7 +25,7 @@ export default { | @@ -25,7 +25,7 @@ export default { | ||
25 | width = this.columnsWidth[column._index].width; | 25 | width = this.columnsWidth[column._index].width; |
26 | } | 26 | } |
27 | // when browser has scrollBar,set a width to resolve scroll position bug | 27 | // when browser has scrollBar,set a width to resolve scroll position bug |
28 | - if (this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) { | 28 | + if (width && this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) { |
29 | width += this.$parent.scrollBarWidth; | 29 | width += this.$parent.scrollBarWidth; |
30 | } | 30 | } |
31 | // when fixed type,reset first right fixed column's width | 31 | // when fixed type,reset first right fixed column's width |