From 8f230d682a9ee24e25b36246d35a094ea3b5dccf Mon Sep 17 00:00:00 2001 From: huanghong <huanghong1125@126.com> Date: Thu, 19 Apr 2018 14:45:02 +0800 Subject: [PATCH] fixed table --- examples/routers/table.vue | 7 +++++++ src/components/table/table.vue | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/routers/table.vue b/examples/routers/table.vue index 3957d2a..539e630 100644 --- a/examples/routers/table.vue +++ b/examples/routers/table.vue @@ -1,3 +1,10 @@ +<style> +table { + border-collapse: collapse; + border-spacing: 0; +} +</style> + <template> <div> <!-- <br><br><br><br><br> --> diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 60ddadb..4af012a 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -374,7 +374,7 @@ let unUsableWidth = hasWidthColumns.map(cell => cell.width).reduce((a, b) => a + b, 0); - let usableWidth = tableWidth - unUsableWidth - sumMinWidth - (this.showVerticalScrollBar?this.scrollBarWidth:0); + let usableWidth = tableWidth - unUsableWidth - sumMinWidth - (this.showVerticalScrollBar?this.scrollBarWidth:0) - 1; let usableLength = noWidthColumns.length; let columnWidth = 0; if(usableWidth > 0 && usableLength > 0){ @@ -447,7 +447,7 @@ } } - this.tableWidth = this.cloneColumns.map(cell => cell._width).reduce((a, b) => a + b, 0) + (this.showVerticalScrollBar?this.scrollBarWidth:0); + this.tableWidth = this.cloneColumns.map(cell => cell._width).reduce((a, b) => a + b, 0) + (this.showVerticalScrollBar?this.scrollBarWidth:0) + 1; this.columnsWidth = columnsWidth; this.fixedHeader(); }, -- libgit2 0.21.4