umy-ui-table 1.2.12 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umy-ui-table",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "一个基于 vue 的 PC 端表格UI库,解决万级数据渲染卡顿问题,过万数据点击全选卡顿,等等问题",
5
5
  "author": {
6
6
  "name": "foriacus"
@@ -41,7 +41,7 @@
41
41
  "resize-observer-polyfill": "^1.5.0",
42
42
  "throttle-debounce": "^1.0.1",
43
43
  "vuedraggable": "^2.23.2",
44
- "tomtaw-vxe-table": "^3.25.4",
44
+ "tomtaw-vxe-table": "^3.25.5",
45
45
  "vxe-pc-ui": "3.16.23",
46
46
  "@vxe-ui/core": "^3.4.19",
47
47
  "xe-utils": ">= 3"
@@ -24,6 +24,7 @@
24
24
  :scroll-x="scrollXConfig"
25
25
  :virtual-y-config="computedVirtualYConfig"
26
26
  :virtual-x-config="computedVirtualXConfig"
27
+ :scrollbar-config="computedScrollbarConfig"
27
28
  :stripe="stripe"
28
29
  :row-config="computedRowConfig"
29
30
  :column-key="columnKey"
@@ -156,6 +157,7 @@ import "./element-renderer";
156
157
  // 所以槽位式 <ux-table-column> 不会被其内部表格收集;这里在组件内解析这些槽位列 vnode,
157
158
  // 转成 columns 配置后经 :columns 交给 VxeGrid,从而兼容原有的 <ux-table-column> 写法
158
159
  import VxeGrid from "./grid-kernel";
160
+ import { VxeUI } from "tomtaw-vxe-table/lib/ui";
159
161
  import uxGridMixin from "../mixins";
160
162
  import { isArrayFn } from "../../utils/common";
161
163
  import { hasGridHeight, resolveGridHeight, getGridHeightInset, observeGridHeight } from "./grid-height";
@@ -173,6 +175,7 @@ export default {
173
175
  newPageSize: "", // 每页条数
174
176
  newcurrentPage: "", // 当前页
175
177
  newHeight: null, // 表格高度
178
+ hasHorizontalOverflow: false,
176
179
  newMaxHeight: null, // 表格最大高度
177
180
  slotColumns: [], // 由槽位式 <ux-table-column> 解析出的列配置(无 columns prop 时使用)
178
181
  slotFormatterRevision: 0,
@@ -219,6 +222,14 @@ export default {
219
222
  if (this.virtualXConfig) return this.virtualXConfig;
220
223
  return this.scrollXConfig;
221
224
  },
225
+ computedScrollbarConfig() {
226
+ const config = VxeUI.getConfig().table.scrollbarConfig || {};
227
+ const xConfig = Object.assign({}, config.x, config.xConfig);
228
+ // The kernel reserves a scrollbar row by default even without overflow.
229
+ // Keep explicit consumer settings; otherwise only reserve it when needed.
230
+ if (xConfig.visible === undefined) xConfig.visible = this.hasHorizontalOverflow;
231
+ return Object.assign({}, config, { xConfig });
232
+ },
222
233
  plTableHeight() {
223
234
  const property = hasGridHeight(this.height) ? "height" : "max-height";
224
235
  let value = property === "height" ? this.height : this.maxHeight;
@@ -282,6 +293,11 @@ export default {
282
293
  },
283
294
  mounted() {
284
295
  this.$ready = true;
296
+ this.$watch(() => {
297
+ const grid = this.$refs.singleTable;
298
+ const table = grid && grid.$refs.refTable;
299
+ return !!(table && table.overflowX);
300
+ }, value => { this.hasHorizontalOverflow = value; }, { immediate: true });
285
301
  this.connectHeightObserver();
286
302
  this.setHeight();
287
303
  // VxeGrid 原生支持 columns prop(mounted 自动 loadColumn + watch 响应变化),无需手动 loadColumn