diff --git a/src/components/u-table-view.vue/__tests__/__snapshots__/demo.test.js.snap b/src/components/u-table-view.vue/__tests__/__snapshots__/demo.test.js.snap index 7349ada3f..7839db7ed 100644 --- a/src/components/u-table-view.vue/__tests__/__snapshots__/demo.test.js.snap +++ b/src/components/u-table-view.vue/__tests__/__snapshots__/demo.test.js.snap @@ -40393,6 +40393,303 @@ exports[`u-table-view.vue Demo-表头文字省略显示 1`] = ` `; +exports[`u-table-view.vue Demo-表格有border 1`] = ` +
+
+
+
+ + + + + + + + + + + + + + + +
+ + 用户名 + + + + 手机号码 + + + + 地址 + + + + 最近登录时间 + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 张三 + + 18612917895 + + 浙江省杭州市滨江区网商路599号网易大厦 + + 2018-05-28 21:52:11 +
+ 小明 + + 13727160283 + + 浙江省杭州市滨江区江虹路459号英飞特科技园 + + 2019-03-12 22:24:36 +
+ 李四 + + 18897127809 + + 浙江省杭州市滨江区秋溢路606号西可科技园 + + 2019-05-18 15:45:30 +
+ 李华 + + 18749261214 + + 浙江省杭州市滨江区长河路590号东忠科技园 + + 2018-12-10 15:48:01 +
+ 王五 + + 13579340020 + + 浙江省杭州市滨江区网商路599号网易大厦二期 + + 2018-07-16 01:32:06 +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + +
+ + 用户名 + + + + 手机号码 + + + + 地址 + + + + 最近登录时间 + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 张三 + + 18612917895 + + 浙江省杭州市滨江区网商路599号网易大厦 + + 2018-05-28 21:52:11 +
+ 小明 + + 13727160283 + + 浙江省杭州市滨江区江虹路459号英飞特科技园 + + 2019-03-12 22:24:36 +
+ 李四 + + 18897127809 + + 浙江省杭州市滨江区秋溢路606号西可科技园 + + 2019-05-18 15:45:30 +
+ 李华 + + 18749261214 + + 浙江省杭州市滨江区长河路590号东忠科技园 + + 2018-12-10 15:48:01 +
+ 王五 + + 13579340020 + + 浙江省杭州市滨江区网商路599号网易大厦二期 + + 2018-07-16 01:32:06 +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+`; + exports[`u-table-view.vue Demo-表格线条 1`] = `
diff --git a/src/components/u-table-view.vue/docs/cases.md b/src/components/u-table-view.vue/docs/cases.md index eea65f7b6..2f03f4f93 100644 --- a/src/components/u-table-view.vue/docs/cases.md +++ b/src/components/u-table-view.vue/docs/cases.md @@ -2726,4 +2726,39 @@ export default { }, }; +``` + +### 表格有border + +``` vue + + ``` \ No newline at end of file diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index 60ba5d5bb..a59806b01 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -9,7 +9,7 @@ {{ title }}
-
@@ -1084,7 +1084,12 @@ export default { this.timer = setTimeout(() => { this.timer = undefined; + // 当最外层加了border后,会导致内部的宽度大于tablewrap的宽度,会出滚动条:Bug-2792431057259520 let rootWidth = this.$el.offsetWidth; + const tablewrapWidth = this.$refs.tablewrap[0] && this.$refs.tablewrap[0].offsetWidth; + if (tablewrapWidth) { + rootWidth = tablewrapWidth; + } if (!rootWidth) { // 初始表格隐藏时,上面的值为0,需要特殊处理 let parentEl = this.$el && this.$el.parentElement;