vxe-table 4.10.6-beta.6 → 4.10.6-beta.8

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.
Files changed (40) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/header.js +7 -2
  6. package/es/table/src/table.js +263 -189
  7. package/es/table/style.css +119 -38
  8. package/es/table/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-table/style.css +119 -38
  12. package/es/vxe-table/style.min.css +1 -1
  13. package/lib/index.css +1 -1
  14. package/lib/index.min.css +1 -1
  15. package/lib/index.umd.js +263 -187
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/header.js +10 -2
  20. package/lib/table/src/header.min.js +1 -1
  21. package/lib/table/src/table.js +251 -183
  22. package/lib/table/src/table.min.js +1 -1
  23. package/lib/table/style/style.css +119 -38
  24. package/lib/table/style/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/vxe-table/style/style.css +119 -38
  30. package/lib/vxe-table/style/style.min.css +1 -1
  31. package/package.json +1 -1
  32. package/packages/table/src/header.ts +7 -2
  33. package/packages/table/src/table.ts +271 -196
  34. package/styles/components/table.scss +149 -60
  35. /package/es/{iconfont.1736779080510.ttf → iconfont.1736840923205.ttf} +0 -0
  36. /package/es/{iconfont.1736779080510.woff → iconfont.1736840923205.woff} +0 -0
  37. /package/es/{iconfont.1736779080510.woff2 → iconfont.1736840923205.woff2} +0 -0
  38. /package/lib/{iconfont.1736779080510.ttf → iconfont.1736840923205.ttf} +0 -0
  39. /package/lib/{iconfont.1736779080510.woff → iconfont.1736840923205.woff} +0 -0
  40. /package/lib/{iconfont.1736779080510.woff2 → iconfont.1736840923205.woff2} +0 -0
@@ -367,9 +367,12 @@ export default defineComponent({
367
367
  const refScrollXVirtualElem = ref();
368
368
  const refScrollYVirtualElem = ref();
369
369
  const refScrollXHandleElem = ref();
370
+ const refScrollXLeftCornerElem = ref();
370
371
  const refScrollXRightCornerElem = ref();
371
372
  const refScrollYHandleElem = ref();
372
373
  const refScrollYTopCornerElem = ref();
374
+ const refScrollXWrapperElem = ref();
375
+ const refScrollYWrapperElem = ref();
373
376
  const refScrollYBottomCornerElem = ref();
374
377
  const refScrollXSpaceElem = ref();
375
378
  const refScrollYSpaceElem = ref();
@@ -419,6 +422,14 @@ export default defineComponent({
419
422
  const computeScrollbarOpts = computed(() => {
420
423
  return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig);
421
424
  });
425
+ const computeScrollbarXToTop = computed(() => {
426
+ const scrollbarOpts = computeScrollbarOpts.value;
427
+ return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top');
428
+ });
429
+ const computeScrollbarYToLeft = computed(() => {
430
+ const scrollbarOpts = computeScrollbarOpts.value;
431
+ return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left');
432
+ });
422
433
  const computeScrollYThreshold = computed(() => {
423
434
  const sYOpts = computeSYOpts.value;
424
435
  const { threshold } = sYOpts;
@@ -679,6 +690,8 @@ export default defineComponent({
679
690
  computeVirtualXOpts,
680
691
  computeVirtualYOpts,
681
692
  computeScrollbarOpts,
693
+ computeScrollbarXToTop,
694
+ computeScrollbarYToLeft,
682
695
  computeColumnOpts,
683
696
  computeScrollXThreshold,
684
697
  computeScrollYThreshold,
@@ -1710,19 +1723,26 @@ export default defineComponent({
1710
1723
  }
1711
1724
  bodyHeight = Math.max(bodyMinHeight, bodyHeight);
1712
1725
  }
1726
+ const xLeftCornerEl = refScrollXLeftCornerElem.value;
1727
+ const xRightCornerEl = refScrollXRightCornerElem.value;
1728
+ const scrollbarXToTop = computeScrollbarXToTop.value;
1713
1729
  const scrollXVirtualEl = refScrollXVirtualElem.value;
1714
1730
  if (scrollXVirtualEl) {
1715
1731
  scrollXVirtualEl.style.height = `${scrollbarHeight}px`;
1716
1732
  scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden';
1717
1733
  }
1718
- const xHandleEl = refScrollXHandleElem.value;
1719
- if (xHandleEl) {
1720
- xHandleEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
1734
+ const xWrapperEl = refScrollXWrapperElem.value;
1735
+ if (xWrapperEl) {
1736
+ xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : '';
1737
+ xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
1738
+ }
1739
+ if (xLeftCornerEl) {
1740
+ xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : '';
1741
+ xLeftCornerEl.style.display = scrollbarXToTop ? (scrollbarWidth && scrollbarHeight ? 'block' : '') : '';
1721
1742
  }
1722
- const xRightCornerEl = refScrollXRightCornerElem.value;
1723
1743
  if (xRightCornerEl) {
1724
- xRightCornerEl.style.width = `${scrollbarWidth}px`;
1725
- xRightCornerEl.style.display = scrollbarWidth && scrollbarHeight ? 'block' : '';
1744
+ xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`;
1745
+ xRightCornerEl.style.display = scrollbarXToTop ? '' : (scrollbarWidth && scrollbarHeight ? 'block' : '');
1726
1746
  }
1727
1747
  const scrollYVirtualEl = refScrollYVirtualElem.value;
1728
1748
  if (scrollYVirtualEl) {
@@ -1735,10 +1755,10 @@ export default defineComponent({
1735
1755
  yTopCornerEl.style.height = `${headerHeight}px`;
1736
1756
  yTopCornerEl.style.display = headerHeight ? 'block' : '';
1737
1757
  }
1738
- const yHandleEl = refScrollYHandleElem.value;
1739
- if (yHandleEl) {
1740
- yHandleEl.style.height = `${bodyHeight}px`;
1741
- yHandleEl.style.top = `${headerHeight}px`;
1758
+ const yWrapperEl = refScrollYWrapperElem.value;
1759
+ if (yWrapperEl) {
1760
+ yWrapperEl.style.height = `${bodyHeight}px`;
1761
+ yWrapperEl.style.top = `${headerHeight}px`;
1742
1762
  }
1743
1763
  const yBottomCornerEl = refScrollYBottomCornerElem.value;
1744
1764
  if (yBottomCornerEl) {
@@ -3109,68 +3129,6 @@ export default defineComponent({
3109
3129
  loadScrollYData();
3110
3130
  }, fpsTime);
3111
3131
  };
3112
- const scrollXEvent = (evnt) => {
3113
- const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData;
3114
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
3115
- return;
3116
- }
3117
- if (inWheelScroll) {
3118
- return;
3119
- }
3120
- const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
3121
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3122
- const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
3123
- const yHandleEl = refScrollYHandleElem.value;
3124
- const wrapperEl = evnt.currentTarget;
3125
- const { scrollLeft } = wrapperEl;
3126
- const yBodyEl = yHandleEl || bodyScrollElem;
3127
- let scrollTop = 0;
3128
- if (yBodyEl) {
3129
- scrollTop = yBodyEl.scrollTop;
3130
- }
3131
- const isRollX = true;
3132
- const isRollY = scrollTop !== lastScrollTop;
3133
- internalData.inVirtualScroll = true;
3134
- setScrollLeft(bodyScrollElem, scrollLeft);
3135
- setScrollLeft(headerScrollElem, scrollLeft);
3136
- setScrollLeft(footerScrollElem, scrollLeft);
3137
- $xeTable.triggerScrollXEvent(evnt);
3138
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
3139
- type: 'table',
3140
- fixed: ''
3141
- });
3142
- };
3143
- const scrollYEvent = (evnt) => {
3144
- const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData;
3145
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
3146
- return;
3147
- }
3148
- if (inWheelScroll) {
3149
- return;
3150
- }
3151
- const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
3152
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3153
- const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
3154
- const xHandleEl = refScrollXHandleElem.value;
3155
- const wrapperEl = evnt.currentTarget;
3156
- const { scrollTop } = wrapperEl;
3157
- const xBodyEl = xHandleEl || bodyScrollElem;
3158
- let scrollLeft = 0;
3159
- if (xBodyEl) {
3160
- scrollLeft = xBodyEl.scrollLeft;
3161
- }
3162
- const isRollX = scrollLeft !== lastScrollLeft;
3163
- const isRollY = true;
3164
- internalData.inVirtualScroll = true;
3165
- setScrollTop(bodyScrollElem, scrollTop);
3166
- setScrollTop(leftScrollElem, scrollTop);
3167
- setScrollTop(rightScrollElem, scrollTop);
3168
- $xeTable.triggerScrollYEvent(evnt);
3169
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
3170
- type: 'table',
3171
- fixed: ''
3172
- });
3173
- };
3174
3132
  const checkLastSyncScroll = (isRollX, isRollY) => {
3175
3133
  const { scrollXLoad, scrollYLoad } = reactData;
3176
3134
  const { lcsTimeout } = internalData;
@@ -3212,6 +3170,12 @@ export default defineComponent({
3212
3170
  }
3213
3171
  return nextTick();
3214
3172
  };
3173
+ function handleUupdateResize() {
3174
+ const el = refElem.value;
3175
+ if (el && el.clientWidth && el.clientHeight) {
3176
+ tableMethods.recalculate();
3177
+ }
3178
+ }
3215
3179
  tableMethods = {
3216
3180
  dispatchEvent,
3217
3181
  /**
@@ -6163,6 +6127,7 @@ export default defineComponent({
6163
6127
  const rdLineEl = refDragRowLineElem.value;
6164
6128
  if (rdLineEl) {
6165
6129
  if (showLine) {
6130
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
6166
6131
  const trRect = trEl.getBoundingClientRect();
6167
6132
  let trHeight = trEl.clientHeight;
6168
6133
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
@@ -6170,6 +6135,7 @@ export default defineComponent({
6170
6135
  trHeight = tableHeight - offsetTop - scrollbarHeight;
6171
6136
  }
6172
6137
  rdLineEl.style.display = 'block';
6138
+ rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
6173
6139
  rdLineEl.style.top = `${offsetTop}px`;
6174
6140
  rdLineEl.style.height = `${trHeight}px`;
6175
6141
  rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
@@ -6185,6 +6151,7 @@ export default defineComponent({
6185
6151
  const cdLineEl = refDragColLineElem.value;
6186
6152
  if (cdLineEl) {
6187
6153
  if (showLine) {
6154
+ const scrollbarXToTop = computeScrollbarXToTop.value;
6188
6155
  const leftContainerElem = refLeftContainer.value;
6189
6156
  const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
6190
6157
  const rightContainerElem = refRightContainer.value;
@@ -6210,7 +6177,7 @@ export default defineComponent({
6210
6177
  cdLineEl.style.height = `${thRect.height}px`;
6211
6178
  }
6212
6179
  else {
6213
- cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`;
6180
+ cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`;
6214
6181
  }
6215
6182
  cdLineEl.setAttribute('drag-pos', dragPos);
6216
6183
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -8302,6 +8269,68 @@ export default defineComponent({
8302
8269
  });
8303
8270
  }
8304
8271
  },
8272
+ triggerVirtualScrollXEvent(evnt) {
8273
+ const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData;
8274
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
8275
+ return;
8276
+ }
8277
+ if (inWheelScroll) {
8278
+ return;
8279
+ }
8280
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
8281
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
8282
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
8283
+ const yHandleEl = refScrollYHandleElem.value;
8284
+ const wrapperEl = evnt.currentTarget;
8285
+ const { scrollLeft } = wrapperEl;
8286
+ const yBodyEl = yHandleEl || bodyScrollElem;
8287
+ let scrollTop = 0;
8288
+ if (yBodyEl) {
8289
+ scrollTop = yBodyEl.scrollTop;
8290
+ }
8291
+ const isRollX = true;
8292
+ const isRollY = scrollTop !== lastScrollTop;
8293
+ internalData.inVirtualScroll = true;
8294
+ setScrollLeft(bodyScrollElem, scrollLeft);
8295
+ setScrollLeft(headerScrollElem, scrollLeft);
8296
+ setScrollLeft(footerScrollElem, scrollLeft);
8297
+ $xeTable.triggerScrollXEvent(evnt);
8298
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
8299
+ type: 'table',
8300
+ fixed: ''
8301
+ });
8302
+ },
8303
+ triggerVirtualScrollYEvent(evnt) {
8304
+ const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData;
8305
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
8306
+ return;
8307
+ }
8308
+ if (inWheelScroll) {
8309
+ return;
8310
+ }
8311
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
8312
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
8313
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
8314
+ const xHandleEl = refScrollXHandleElem.value;
8315
+ const wrapperEl = evnt.currentTarget;
8316
+ const { scrollTop } = wrapperEl;
8317
+ const xBodyEl = xHandleEl || bodyScrollElem;
8318
+ let scrollLeft = 0;
8319
+ if (xBodyEl) {
8320
+ scrollLeft = xBodyEl.scrollLeft;
8321
+ }
8322
+ const isRollX = scrollLeft !== lastScrollLeft;
8323
+ const isRollY = true;
8324
+ internalData.inVirtualScroll = true;
8325
+ setScrollTop(bodyScrollElem, scrollTop);
8326
+ setScrollTop(leftScrollElem, scrollTop);
8327
+ setScrollTop(rightScrollElem, scrollTop);
8328
+ $xeTable.triggerScrollYEvent(evnt);
8329
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
8330
+ type: 'table',
8331
+ fixed: ''
8332
+ });
8333
+ },
8305
8334
  /**
8306
8335
  * 对于树形结构中,可以直接滚动到指定深层节点中
8307
8336
  * 对于某些特定的场景可能会用到,比如定位到某一节点
@@ -8674,15 +8703,133 @@ export default defineComponent({
8674
8703
  }
8675
8704
  return renderEmptyElement($xeTable);
8676
8705
  };
8677
- function handleUupdateResize() {
8678
- const el = refElem.value;
8679
- if (el && el.clientWidth && el.clientHeight) {
8680
- tableMethods.recalculate();
8681
- }
8682
- }
8706
+ const renderScrollX = () => {
8707
+ return h('div', {
8708
+ key: 'vsx',
8709
+ ref: refScrollXVirtualElem,
8710
+ class: 'vxe-table--scroll-x-virtual'
8711
+ }, [
8712
+ h('div', {
8713
+ ref: refScrollXLeftCornerElem,
8714
+ class: 'vxe-table--scroll-x-left-corner'
8715
+ }),
8716
+ h('div', {
8717
+ ref: refScrollXWrapperElem,
8718
+ class: 'vxe-table--scroll-x-wrapper'
8719
+ }, [
8720
+ h('div', {
8721
+ ref: refScrollXHandleElem,
8722
+ class: 'vxe-table--scroll-x-handle',
8723
+ onScroll: $xeTable.triggerVirtualScrollXEvent
8724
+ }, [
8725
+ h('div', {
8726
+ ref: refScrollXSpaceElem,
8727
+ class: 'vxe-table--scroll-x-space'
8728
+ })
8729
+ ])
8730
+ ]),
8731
+ h('div', {
8732
+ ref: refScrollXRightCornerElem,
8733
+ class: 'vxe-table--scroll-x-right-corner'
8734
+ })
8735
+ ]);
8736
+ };
8737
+ const renderScrollY = () => {
8738
+ return h('div', {
8739
+ ref: refScrollYVirtualElem,
8740
+ class: 'vxe-table--scroll-y-virtual'
8741
+ }, [
8742
+ h('div', {
8743
+ ref: refScrollYTopCornerElem,
8744
+ class: 'vxe-table--scroll-y-top-corner'
8745
+ }),
8746
+ h('div', {
8747
+ ref: refScrollYWrapperElem,
8748
+ class: 'vxe-table--scroll-y-wrapper'
8749
+ }, [
8750
+ h('div', {
8751
+ ref: refScrollYHandleElem,
8752
+ class: 'vxe-table--scroll-y-handle',
8753
+ onScroll: $xeTable.triggerVirtualScrollYEvent
8754
+ }, [
8755
+ h('div', {
8756
+ ref: refScrollYSpaceElem,
8757
+ class: 'vxe-table--scroll-y-space'
8758
+ })
8759
+ ])
8760
+ ]),
8761
+ h('div', {
8762
+ ref: refScrollYBottomCornerElem,
8763
+ class: 'vxe-table--scroll-y-bottom-corner'
8764
+ })
8765
+ ]);
8766
+ };
8767
+ const renderViewport = () => {
8768
+ const { showHeader, showFooter } = props;
8769
+ const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
8770
+ const { leftList, rightList } = columnStore;
8771
+ return h('div', {
8772
+ ref: refTableViewportElem,
8773
+ class: 'vxe-table--viewport-wrapper'
8774
+ }, [
8775
+ h('div', {
8776
+ class: 'vxe-table--main-wrapper'
8777
+ }, [
8778
+ /**
8779
+ * 表头
8780
+ */
8781
+ showHeader
8782
+ ? h(TableHeaderComponent, {
8783
+ ref: refTableHeader,
8784
+ tableData,
8785
+ tableColumn,
8786
+ tableGroupColumn
8787
+ })
8788
+ : renderEmptyElement($xeTable),
8789
+ /**
8790
+ * 表体
8791
+ */
8792
+ h(TableBodyComponent, {
8793
+ ref: refTableBody,
8794
+ tableData,
8795
+ tableColumn
8796
+ }),
8797
+ /**
8798
+ * 表尾
8799
+ */
8800
+ showFooter
8801
+ ? h(TableFooterComponent, {
8802
+ ref: refTableFooter,
8803
+ footerTableData,
8804
+ tableColumn
8805
+ })
8806
+ : renderEmptyElement($xeTable)
8807
+ ]),
8808
+ h('div', {
8809
+ class: 'vxe-table--fixed-wrapper'
8810
+ }, [
8811
+ leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable),
8812
+ rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)
8813
+ ])
8814
+ ]);
8815
+ };
8816
+ const renderBody = () => {
8817
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
8818
+ return h('div', {
8819
+ class: 'vxe-table--layout-wrapper'
8820
+ }, scrollbarYToLeft
8821
+ ? [
8822
+ renderScrollY(),
8823
+ renderViewport()
8824
+ ]
8825
+ : [
8826
+ renderViewport(),
8827
+ renderScrollY()
8828
+ ]);
8829
+ };
8683
8830
  const renderVN = () => {
8684
8831
  const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
8685
- const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData;
8832
+ const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData;
8686
8833
  const { leftList, rightList } = columnStore;
8687
8834
  const loadingSlot = slots.loading;
8688
8835
  const tooltipOpts = computeTooltipOpts.value;
@@ -8701,9 +8848,11 @@ export default defineComponent({
8701
8848
  const resizableOpts = computeResizableOpts.value;
8702
8849
  const isArea = mouseConfig && mouseOpts.area;
8703
8850
  const columnDragOpts = computeColumnDragOpts.value;
8851
+ const scrollbarXToTop = computeScrollbarXToTop.value;
8852
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
8704
8853
  return h('div', {
8705
8854
  ref: refElem,
8706
- class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
8855
+ class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
8707
8856
  [`size--${vSize}`]: vSize,
8708
8857
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
8709
8858
  'vxe-editable': !!editConfig,
@@ -8747,95 +8896,15 @@ export default defineComponent({
8747
8896
  h('div', {
8748
8897
  key: 'tw',
8749
8898
  class: 'vxe-table--render-wrapper'
8750
- }, [
8751
- h('div', {
8752
- ref: refTableViewportElem,
8753
- class: 'vxe-table--viewport-wrapper'
8754
- }, [
8755
- h('div', {
8756
- class: 'vxe-table--main-wrapper'
8757
- }, [
8758
- /**
8759
- * 表头
8760
- */
8761
- showHeader
8762
- ? h(TableHeaderComponent, {
8763
- ref: refTableHeader,
8764
- tableData,
8765
- tableColumn,
8766
- tableGroupColumn
8767
- })
8768
- : renderEmptyElement($xeTable),
8769
- /**
8770
- * 表体
8771
- */
8772
- h(TableBodyComponent, {
8773
- ref: refTableBody,
8774
- tableData,
8775
- tableColumn
8776
- }),
8777
- /**
8778
- * 表尾
8779
- */
8780
- showFooter
8781
- ? h(TableFooterComponent, {
8782
- ref: refTableFooter,
8783
- footerTableData,
8784
- tableColumn
8785
- })
8786
- : renderEmptyElement($xeTable)
8787
- ]),
8788
- h('div', {
8789
- class: 'vxe-table--fixed-wrapper'
8790
- }, [
8791
- leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable),
8792
- rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)
8793
- ])
8794
- ]),
8795
- h('div', {
8796
- ref: refScrollYVirtualElem,
8797
- class: 'vxe-table--scroll-y-virtual'
8798
- }, [
8799
- h('div', {
8800
- ref: refScrollYTopCornerElem,
8801
- class: 'vxe-table--scroll-y-top-corner'
8802
- }),
8803
- h('div', {
8804
- ref: refScrollYHandleElem,
8805
- class: 'vxe-table--scroll-y-handle',
8806
- onScroll: scrollYEvent
8807
- }, [
8808
- h('div', {
8809
- ref: refScrollYSpaceElem,
8810
- class: 'vxe-table--scroll-y-space'
8811
- })
8812
- ]),
8813
- h('div', {
8814
- ref: refScrollYBottomCornerElem,
8815
- class: 'vxe-table--scroll-y-bottom-corner'
8816
- })
8817
- ])
8818
- ]),
8819
- h('div', {
8820
- key: 'vx',
8821
- ref: refScrollXVirtualElem,
8822
- class: 'vxe-table--scroll-x-virtual'
8823
- }, [
8824
- h('div', {
8825
- ref: refScrollXHandleElem,
8826
- class: 'vxe-table--scroll-x-handle',
8827
- onScroll: scrollXEvent
8828
- }, [
8829
- h('div', {
8830
- ref: refScrollXSpaceElem,
8831
- class: 'vxe-table--scroll-x-space'
8832
- })
8899
+ }, scrollbarXToTop
8900
+ ? [
8901
+ renderScrollX(),
8902
+ renderBody()
8903
+ ]
8904
+ : [
8905
+ renderBody(),
8906
+ renderScrollX()
8833
8907
  ]),
8834
- h('div', {
8835
- ref: refScrollXRightCornerElem,
8836
- class: 'vxe-table--scroll-x-right-corner'
8837
- })
8838
- ]),
8839
8908
  /**
8840
8909
  * 空数据
8841
8910
  */
@@ -8861,12 +8930,7 @@ export default defineComponent({
8861
8930
  h('div', {
8862
8931
  key: 'cl',
8863
8932
  ref: refCellResizeBar,
8864
- class: 'vxe-table--resizable-bar',
8865
- style: overflowX
8866
- ? {
8867
- 'padding-bottom': `${scrollbarHeight}px`
8868
- }
8869
- : null
8933
+ class: 'vxe-table--resizable-bar'
8870
8934
  }, resizableOpts.showDragTip
8871
8935
  ? [
8872
8936
  h('div', {
@@ -9044,16 +9108,37 @@ export default defineComponent({
9044
9108
  tableMethods.refreshColumn();
9045
9109
  });
9046
9110
  });
9111
+ const reScrollFlag = ref(0);
9112
+ watch(computeSize, () => {
9113
+ reScrollFlag.value++;
9114
+ });
9047
9115
  watch(() => props.showHeader, () => {
9048
- nextTick(() => {
9049
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
9050
- });
9116
+ reScrollFlag.value++;
9051
9117
  });
9052
9118
  watch(() => props.showFooter, () => {
9119
+ reScrollFlag.value++;
9120
+ });
9121
+ watch(reScrollFlag, () => {
9053
9122
  nextTick(() => {
9054
9123
  tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
9055
9124
  });
9056
9125
  });
9126
+ const reLayoutFlag = ref(0);
9127
+ watch(() => props.height, () => {
9128
+ reLayoutFlag.value++;
9129
+ });
9130
+ watch(() => props.maxHeight, () => {
9131
+ reLayoutFlag.value++;
9132
+ });
9133
+ watch(computeScrollbarXToTop, () => {
9134
+ reLayoutFlag.value++;
9135
+ });
9136
+ watch(computeScrollbarYToLeft, () => {
9137
+ reLayoutFlag.value++;
9138
+ });
9139
+ watch(reLayoutFlag, () => {
9140
+ nextTick(() => tableMethods.recalculate(true));
9141
+ });
9057
9142
  const footFlag = ref(0);
9058
9143
  watch(() => props.footerData ? props.footerData.length : -1, () => {
9059
9144
  footFlag.value++;
@@ -9064,17 +9149,6 @@ export default defineComponent({
9064
9149
  watch(footFlag, () => {
9065
9150
  tableMethods.updateFooter();
9066
9151
  });
9067
- watch(() => props.height, () => {
9068
- nextTick(() => tableMethods.recalculate(true));
9069
- });
9070
- watch(() => props.maxHeight, () => {
9071
- nextTick(() => tableMethods.recalculate(true));
9072
- });
9073
- watch(computeSize, () => {
9074
- nextTick(() => {
9075
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
9076
- });
9077
- });
9078
9152
  watch(() => props.syncResize, (value) => {
9079
9153
  if (value) {
9080
9154
  handleUupdateResize();