From eec3859c1153752f6ac5601f7e397b1e8ad6928d Mon Sep 17 00:00:00 2001 From: huanghong Date: Tue, 27 Mar 2018 22:26:56 +0800 Subject: [PATCH] fixed table scollbar --- examples/routers/table.vue | 2 +- src/components/table/mixin.js | 26 +------------------------- src/components/table/table-body.vue | 2 +- src/components/table/table-head.vue | 12 +++++------- src/components/table/table.vue | 11 ++++++++++- src/styles/components/table.less | 2 +- 6 files changed, 19 insertions(+), 36 deletions(-) diff --git a/examples/routers/table.vue b/examples/routers/table.vue index 58ee9b5..71b86e1 100644 --- a/examples/routers/table.vue +++ b/examples/routers/table.vue @@ -5,7 +5,7 @@




-
+










diff --git a/src/components/table/mixin.js b/src/components/table/mixin.js index 63566d6..3422455 100644 --- a/src/components/table/mixin.js +++ b/src/components/table/mixin.js @@ -17,37 +17,13 @@ export default { isPopperShow (column) { return column.filters && ((!this.fixed && !column.fixed) || (this.fixed === 'left' && column.fixed === 'left') || (this.fixed === 'right' && column.fixed === 'right')); }, - setCellWidth (column, index, top) { + setCellWidth (column) { let width = ''; if (column.width) { width = column.width; } else if (this.columnsWidth[column._index]) { width = this.columnsWidth[column._index].width; } - // when browser has scrollBar,set a width to resolve scroll position bug - if (width && this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0 && column.fixed!=='left' && !this.fixed) { - let scrollBarWidth = this.$parent.scrollBarWidth; - if (!this.$parent.showVerticalScrollBar) scrollBarWidth = 0; - width += scrollBarWidth; - } - // when fixed type,reset first right fixed column's width - if (this.fixed === 'right' && top ) { - //const firstFixedIndex = this.columns.lastIndexOf((col) => col.fixed === 'right'); - let lastFixedIndex = -1; - for(let i=0;i - +