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
@@ -391,9 +391,12 @@ export default defineComponent({
391
391
  const refScrollXVirtualElem = ref<HTMLDivElement>()
392
392
  const refScrollYVirtualElem = ref<HTMLDivElement>()
393
393
  const refScrollXHandleElem = ref<HTMLDivElement>()
394
+ const refScrollXLeftCornerElem = ref<HTMLDivElement>()
394
395
  const refScrollXRightCornerElem = ref<HTMLDivElement>()
395
396
  const refScrollYHandleElem = ref<HTMLDivElement>()
396
397
  const refScrollYTopCornerElem = ref<HTMLDivElement>()
398
+ const refScrollXWrapperElem = ref<HTMLDivElement>()
399
+ const refScrollYWrapperElem = ref<HTMLDivElement>()
397
400
  const refScrollYBottomCornerElem = ref<HTMLDivElement>()
398
401
  const refScrollXSpaceElem = ref<HTMLDivElement>()
399
402
  const refScrollYSpaceElem = ref<HTMLDivElement>()
@@ -453,6 +456,16 @@ export default defineComponent({
453
456
  return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig)
454
457
  })
455
458
 
459
+ const computeScrollbarXToTop = computed(() => {
460
+ const scrollbarOpts = computeScrollbarOpts.value
461
+ return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top')
462
+ })
463
+
464
+ const computeScrollbarYToLeft = computed(() => {
465
+ const scrollbarOpts = computeScrollbarOpts.value
466
+ return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left')
467
+ })
468
+
456
469
  const computeScrollYThreshold = computed(() => {
457
470
  const sYOpts = computeSYOpts.value
458
471
  const { threshold } = sYOpts
@@ -759,6 +772,8 @@ export default defineComponent({
759
772
  computeVirtualXOpts,
760
773
  computeVirtualYOpts,
761
774
  computeScrollbarOpts,
775
+ computeScrollbarXToTop,
776
+ computeScrollbarYToLeft,
762
777
  computeColumnOpts,
763
778
  computeScrollXThreshold,
764
779
  computeScrollYThreshold,
@@ -1810,19 +1825,26 @@ export default defineComponent({
1810
1825
  bodyHeight = Math.max(bodyMinHeight, bodyHeight)
1811
1826
  }
1812
1827
 
1828
+ const xLeftCornerEl = refScrollXLeftCornerElem.value
1829
+ const xRightCornerEl = refScrollXRightCornerElem.value
1830
+ const scrollbarXToTop = computeScrollbarXToTop.value
1813
1831
  const scrollXVirtualEl = refScrollXVirtualElem.value
1814
1832
  if (scrollXVirtualEl) {
1815
1833
  scrollXVirtualEl.style.height = `${scrollbarHeight}px`
1816
1834
  scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden'
1817
1835
  }
1818
- const xHandleEl = refScrollXHandleElem.value
1819
- if (xHandleEl) {
1820
- xHandleEl.style.width = `${el.clientWidth - scrollbarWidth}px`
1836
+ const xWrapperEl = refScrollXWrapperElem.value
1837
+ if (xWrapperEl) {
1838
+ xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : ''
1839
+ xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`
1840
+ }
1841
+ if (xLeftCornerEl) {
1842
+ xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : ''
1843
+ xLeftCornerEl.style.display = scrollbarXToTop ? (scrollbarWidth && scrollbarHeight ? 'block' : '') : ''
1821
1844
  }
1822
- const xRightCornerEl = refScrollXRightCornerElem.value
1823
1845
  if (xRightCornerEl) {
1824
- xRightCornerEl.style.width = `${scrollbarWidth}px`
1825
- xRightCornerEl.style.display = scrollbarWidth && scrollbarHeight ? 'block' : ''
1846
+ xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`
1847
+ xRightCornerEl.style.display = scrollbarXToTop ? '' : (scrollbarWidth && scrollbarHeight ? 'block' : '')
1826
1848
  }
1827
1849
 
1828
1850
  const scrollYVirtualEl = refScrollYVirtualElem.value
@@ -1836,10 +1858,10 @@ export default defineComponent({
1836
1858
  yTopCornerEl.style.height = `${headerHeight}px`
1837
1859
  yTopCornerEl.style.display = headerHeight ? 'block' : ''
1838
1860
  }
1839
- const yHandleEl = refScrollYHandleElem.value
1840
- if (yHandleEl) {
1841
- yHandleEl.style.height = `${bodyHeight}px`
1842
- yHandleEl.style.top = `${headerHeight}px`
1861
+ const yWrapperEl = refScrollYWrapperElem.value
1862
+ if (yWrapperEl) {
1863
+ yWrapperEl.style.height = `${bodyHeight}px`
1864
+ yWrapperEl.style.top = `${headerHeight}px`
1843
1865
  }
1844
1866
  const yBottomCornerEl = refScrollYBottomCornerElem.value
1845
1867
  if (yBottomCornerEl) {
@@ -3242,72 +3264,6 @@ export default defineComponent({
3242
3264
  }, fpsTime)
3243
3265
  }
3244
3266
 
3245
- const scrollXEvent = (evnt: Event) => {
3246
- const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
3247
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
3248
- return
3249
- }
3250
- if (inWheelScroll) {
3251
- return
3252
- }
3253
- const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
3254
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
3255
- const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
3256
- const yHandleEl = refScrollYHandleElem.value
3257
- const wrapperEl = evnt.currentTarget as HTMLDivElement
3258
- const { scrollLeft } = wrapperEl
3259
- const yBodyEl = yHandleEl || bodyScrollElem
3260
- let scrollTop = 0
3261
- if (yBodyEl) {
3262
- scrollTop = yBodyEl.scrollTop
3263
- }
3264
- const isRollX = true
3265
- const isRollY = scrollTop !== lastScrollTop
3266
-
3267
- internalData.inVirtualScroll = true
3268
- setScrollLeft(bodyScrollElem, scrollLeft)
3269
- setScrollLeft(headerScrollElem, scrollLeft)
3270
- setScrollLeft(footerScrollElem, scrollLeft)
3271
- $xeTable.triggerScrollXEvent(evnt)
3272
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
3273
- type: 'table',
3274
- fixed: ''
3275
- })
3276
- }
3277
-
3278
- const scrollYEvent = (evnt: Event) => {
3279
- const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
3280
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
3281
- return
3282
- }
3283
- if (inWheelScroll) {
3284
- return
3285
- }
3286
- const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
3287
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
3288
- const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
3289
- const xHandleEl = refScrollXHandleElem.value
3290
- const wrapperEl = evnt.currentTarget as HTMLDivElement
3291
- const { scrollTop } = wrapperEl
3292
- const xBodyEl = xHandleEl || bodyScrollElem
3293
- let scrollLeft = 0
3294
- if (xBodyEl) {
3295
- scrollLeft = xBodyEl.scrollLeft
3296
- }
3297
- const isRollX = scrollLeft !== lastScrollLeft
3298
- const isRollY = true
3299
-
3300
- internalData.inVirtualScroll = true
3301
- setScrollTop(bodyScrollElem, scrollTop)
3302
- setScrollTop(leftScrollElem, scrollTop)
3303
- setScrollTop(rightScrollElem, scrollTop)
3304
- $xeTable.triggerScrollYEvent(evnt)
3305
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
3306
- type: 'table',
3307
- fixed: ''
3308
- })
3309
- }
3310
-
3311
3267
  const checkLastSyncScroll = (isRollX: boolean, isRollY: boolean) => {
3312
3268
  const { scrollXLoad, scrollYLoad } = reactData
3313
3269
  const { lcsTimeout } = internalData
@@ -3352,6 +3308,13 @@ export default defineComponent({
3352
3308
  return nextTick()
3353
3309
  }
3354
3310
 
3311
+ function handleUupdateResize () {
3312
+ const el = refElem.value
3313
+ if (el && el.clientWidth && el.clientHeight) {
3314
+ tableMethods.recalculate()
3315
+ }
3316
+ }
3317
+
3355
3318
  tableMethods = {
3356
3319
  dispatchEvent,
3357
3320
  /**
@@ -6270,6 +6233,7 @@ export default defineComponent({
6270
6233
  const rdLineEl = refDragRowLineElem.value
6271
6234
  if (rdLineEl) {
6272
6235
  if (showLine) {
6236
+ const scrollbarYToLeft = computeScrollbarYToLeft.value
6273
6237
  const trRect = trEl.getBoundingClientRect()
6274
6238
  let trHeight = trEl.clientHeight
6275
6239
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y)
@@ -6277,6 +6241,7 @@ export default defineComponent({
6277
6241
  trHeight = tableHeight - offsetTop - scrollbarHeight
6278
6242
  }
6279
6243
  rdLineEl.style.display = 'block'
6244
+ rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`
6280
6245
  rdLineEl.style.top = `${offsetTop}px`
6281
6246
  rdLineEl.style.height = `${trHeight}px`
6282
6247
  rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`
@@ -6290,6 +6255,7 @@ export default defineComponent({
6290
6255
  const cdLineEl = refDragColLineElem.value
6291
6256
  if (cdLineEl) {
6292
6257
  if (showLine) {
6258
+ const scrollbarXToTop = computeScrollbarXToTop.value
6293
6259
  const leftContainerElem = refLeftContainer.value
6294
6260
  const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0
6295
6261
  const rightContainerElem = refRightContainer.value
@@ -6314,7 +6280,7 @@ export default defineComponent({
6314
6280
  if (prevDragToChild) {
6315
6281
  cdLineEl.style.height = `${thRect.height}px`
6316
6282
  } else {
6317
- cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`
6283
+ cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`
6318
6284
  }
6319
6285
  cdLineEl.setAttribute('drag-pos', dragPos)
6320
6286
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
@@ -8407,6 +8373,70 @@ export default defineComponent({
8407
8373
  })
8408
8374
  }
8409
8375
  },
8376
+ triggerVirtualScrollXEvent (evnt) {
8377
+ const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
8378
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
8379
+ return
8380
+ }
8381
+ if (inWheelScroll) {
8382
+ return
8383
+ }
8384
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
8385
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
8386
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
8387
+ const yHandleEl = refScrollYHandleElem.value
8388
+ const wrapperEl = evnt.currentTarget as HTMLDivElement
8389
+ const { scrollLeft } = wrapperEl
8390
+ const yBodyEl = yHandleEl || bodyScrollElem
8391
+ let scrollTop = 0
8392
+ if (yBodyEl) {
8393
+ scrollTop = yBodyEl.scrollTop
8394
+ }
8395
+ const isRollX = true
8396
+ const isRollY = scrollTop !== lastScrollTop
8397
+
8398
+ internalData.inVirtualScroll = true
8399
+ setScrollLeft(bodyScrollElem, scrollLeft)
8400
+ setScrollLeft(headerScrollElem, scrollLeft)
8401
+ setScrollLeft(footerScrollElem, scrollLeft)
8402
+ $xeTable.triggerScrollXEvent(evnt)
8403
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
8404
+ type: 'table',
8405
+ fixed: ''
8406
+ })
8407
+ },
8408
+ triggerVirtualScrollYEvent (evnt) {
8409
+ const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
8410
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
8411
+ return
8412
+ }
8413
+ if (inWheelScroll) {
8414
+ return
8415
+ }
8416
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
8417
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
8418
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
8419
+ const xHandleEl = refScrollXHandleElem.value
8420
+ const wrapperEl = evnt.currentTarget as HTMLDivElement
8421
+ const { scrollTop } = wrapperEl
8422
+ const xBodyEl = xHandleEl || bodyScrollElem
8423
+ let scrollLeft = 0
8424
+ if (xBodyEl) {
8425
+ scrollLeft = xBodyEl.scrollLeft
8426
+ }
8427
+ const isRollX = scrollLeft !== lastScrollLeft
8428
+ const isRollY = true
8429
+
8430
+ internalData.inVirtualScroll = true
8431
+ setScrollTop(bodyScrollElem, scrollTop)
8432
+ setScrollTop(leftScrollElem, scrollTop)
8433
+ setScrollTop(rightScrollElem, scrollTop)
8434
+ $xeTable.triggerScrollYEvent(evnt)
8435
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
8436
+ type: 'table',
8437
+ fixed: ''
8438
+ })
8439
+ },
8410
8440
  /**
8411
8441
  * 对于树形结构中,可以直接滚动到指定深层节点中
8412
8442
  * 对于某些特定的场景可能会用到,比如定位到某一节点
@@ -8782,16 +8812,137 @@ export default defineComponent({
8782
8812
  return renderEmptyElement($xeTable)
8783
8813
  }
8784
8814
 
8785
- function handleUupdateResize () {
8786
- const el = refElem.value
8787
- if (el && el.clientWidth && el.clientHeight) {
8788
- tableMethods.recalculate()
8789
- }
8815
+ const renderScrollX = () => {
8816
+ return h('div', {
8817
+ key: 'vsx',
8818
+ ref: refScrollXVirtualElem,
8819
+ class: 'vxe-table--scroll-x-virtual'
8820
+ }, [
8821
+ h('div', {
8822
+ ref: refScrollXLeftCornerElem,
8823
+ class: 'vxe-table--scroll-x-left-corner'
8824
+ }),
8825
+ h('div', {
8826
+ ref: refScrollXWrapperElem,
8827
+ class: 'vxe-table--scroll-x-wrapper'
8828
+ }, [
8829
+ h('div', {
8830
+ ref: refScrollXHandleElem,
8831
+ class: 'vxe-table--scroll-x-handle',
8832
+ onScroll: $xeTable.triggerVirtualScrollXEvent
8833
+ }, [
8834
+ h('div', {
8835
+ ref: refScrollXSpaceElem,
8836
+ class: 'vxe-table--scroll-x-space'
8837
+ })
8838
+ ])
8839
+ ]),
8840
+ h('div', {
8841
+ ref: refScrollXRightCornerElem,
8842
+ class: 'vxe-table--scroll-x-right-corner'
8843
+ })
8844
+ ])
8845
+ }
8846
+
8847
+ const renderScrollY = () => {
8848
+ return h('div', {
8849
+ ref: refScrollYVirtualElem,
8850
+ class: 'vxe-table--scroll-y-virtual'
8851
+ }, [
8852
+ h('div', {
8853
+ ref: refScrollYTopCornerElem,
8854
+ class: 'vxe-table--scroll-y-top-corner'
8855
+ }),
8856
+ h('div', {
8857
+ ref: refScrollYWrapperElem,
8858
+ class: 'vxe-table--scroll-y-wrapper'
8859
+ }, [
8860
+ h('div', {
8861
+ ref: refScrollYHandleElem,
8862
+ class: 'vxe-table--scroll-y-handle',
8863
+ onScroll: $xeTable.triggerVirtualScrollYEvent
8864
+ }, [
8865
+ h('div', {
8866
+ ref: refScrollYSpaceElem,
8867
+ class: 'vxe-table--scroll-y-space'
8868
+ })
8869
+ ])
8870
+ ]),
8871
+ h('div', {
8872
+ ref: refScrollYBottomCornerElem,
8873
+ class: 'vxe-table--scroll-y-bottom-corner'
8874
+ })
8875
+ ])
8876
+ }
8877
+
8878
+ const renderViewport = () => {
8879
+ const { showHeader, showFooter } = props
8880
+ const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
8881
+ const { leftList, rightList } = columnStore
8882
+ return h('div', {
8883
+ ref: refTableViewportElem,
8884
+ class: 'vxe-table--viewport-wrapper'
8885
+ }, [
8886
+ h('div', {
8887
+ class: 'vxe-table--main-wrapper'
8888
+ }, [
8889
+ /**
8890
+ * 表头
8891
+ */
8892
+ showHeader
8893
+ ? h(TableHeaderComponent, {
8894
+ ref: refTableHeader,
8895
+ tableData,
8896
+ tableColumn,
8897
+ tableGroupColumn
8898
+ })
8899
+ : renderEmptyElement($xeTable),
8900
+ /**
8901
+ * 表体
8902
+ */
8903
+ h(TableBodyComponent, {
8904
+ ref: refTableBody,
8905
+ tableData,
8906
+ tableColumn
8907
+ }),
8908
+ /**
8909
+ * 表尾
8910
+ */
8911
+ showFooter
8912
+ ? h(TableFooterComponent, {
8913
+ ref: refTableFooter,
8914
+ footerTableData,
8915
+ tableColumn
8916
+ })
8917
+ : renderEmptyElement($xeTable)
8918
+ ]),
8919
+ h('div', {
8920
+ class: 'vxe-table--fixed-wrapper'
8921
+ }, [
8922
+ leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable),
8923
+ rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)
8924
+ ])
8925
+ ])
8926
+ }
8927
+
8928
+ const renderBody = () => {
8929
+ const scrollbarYToLeft = computeScrollbarYToLeft.value
8930
+ return h('div', {
8931
+ class: 'vxe-table--layout-wrapper'
8932
+ }, scrollbarYToLeft
8933
+ ? [
8934
+ renderScrollY(),
8935
+ renderViewport()
8936
+ ]
8937
+ : [
8938
+ renderViewport(),
8939
+ renderScrollY()
8940
+ ])
8790
8941
  }
8791
8942
 
8792
8943
  const renderVN = () => {
8793
8944
  const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
8794
- const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData
8945
+ const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData
8795
8946
  const { leftList, rightList } = columnStore
8796
8947
  const loadingSlot = slots.loading
8797
8948
  const tooltipOpts = computeTooltipOpts.value
@@ -8810,9 +8961,11 @@ export default defineComponent({
8810
8961
  const resizableOpts = computeResizableOpts.value
8811
8962
  const isArea = mouseConfig && mouseOpts.area
8812
8963
  const columnDragOpts = computeColumnDragOpts.value
8964
+ const scrollbarXToTop = computeScrollbarXToTop.value
8965
+ const scrollbarYToLeft = computeScrollbarYToLeft.value
8813
8966
  return h('div', {
8814
8967
  ref: refElem,
8815
- class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
8968
+ class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
8816
8969
  [`size--${vSize}`]: vSize,
8817
8970
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
8818
8971
  'vxe-editable': !!editConfig,
@@ -8856,95 +9009,15 @@ export default defineComponent({
8856
9009
  h('div', {
8857
9010
  key: 'tw',
8858
9011
  class: 'vxe-table--render-wrapper'
8859
- }, [
8860
- h('div', {
8861
- ref: refTableViewportElem,
8862
- class: 'vxe-table--viewport-wrapper'
8863
- }, [
8864
- h('div', {
8865
- class: 'vxe-table--main-wrapper'
8866
- }, [
8867
- /**
8868
- * 表头
8869
- */
8870
- showHeader
8871
- ? h(TableHeaderComponent, {
8872
- ref: refTableHeader,
8873
- tableData,
8874
- tableColumn,
8875
- tableGroupColumn
8876
- })
8877
- : renderEmptyElement($xeTable),
8878
- /**
8879
- * 表体
8880
- */
8881
- h(TableBodyComponent, {
8882
- ref: refTableBody,
8883
- tableData,
8884
- tableColumn
8885
- }),
8886
- /**
8887
- * 表尾
8888
- */
8889
- showFooter
8890
- ? h(TableFooterComponent, {
8891
- ref: refTableFooter,
8892
- footerTableData,
8893
- tableColumn
8894
- })
8895
- : renderEmptyElement($xeTable)
8896
- ]),
8897
- h('div', {
8898
- class: 'vxe-table--fixed-wrapper'
8899
- }, [
8900
- leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable),
8901
- rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)
8902
- ])
8903
- ]),
8904
- h('div', {
8905
- ref: refScrollYVirtualElem,
8906
- class: 'vxe-table--scroll-y-virtual'
8907
- }, [
8908
- h('div', {
8909
- ref: refScrollYTopCornerElem,
8910
- class: 'vxe-table--scroll-y-top-corner'
8911
- }),
8912
- h('div', {
8913
- ref: refScrollYHandleElem,
8914
- class: 'vxe-table--scroll-y-handle',
8915
- onScroll: scrollYEvent
8916
- }, [
8917
- h('div', {
8918
- ref: refScrollYSpaceElem,
8919
- class: 'vxe-table--scroll-y-space'
8920
- })
9012
+ }, scrollbarXToTop
9013
+ ? [
9014
+ renderScrollX(),
9015
+ renderBody()
9016
+ ]
9017
+ : [
9018
+ renderBody(),
9019
+ renderScrollX()
8921
9020
  ]),
8922
- h('div', {
8923
- ref: refScrollYBottomCornerElem,
8924
- class: 'vxe-table--scroll-y-bottom-corner'
8925
- })
8926
- ])
8927
- ]),
8928
- h('div', {
8929
- key: 'vx',
8930
- ref: refScrollXVirtualElem,
8931
- class: 'vxe-table--scroll-x-virtual'
8932
- }, [
8933
- h('div', {
8934
- ref: refScrollXHandleElem,
8935
- class: 'vxe-table--scroll-x-handle',
8936
- onScroll: scrollXEvent
8937
- }, [
8938
- h('div', {
8939
- ref: refScrollXSpaceElem,
8940
- class: 'vxe-table--scroll-x-space'
8941
- })
8942
- ]),
8943
- h('div', {
8944
- ref: refScrollXRightCornerElem,
8945
- class: 'vxe-table--scroll-x-right-corner'
8946
- })
8947
- ]),
8948
9021
  /**
8949
9022
  * 空数据
8950
9023
  */
@@ -8970,12 +9043,7 @@ export default defineComponent({
8970
9043
  h('div', {
8971
9044
  key: 'cl',
8972
9045
  ref: refCellResizeBar,
8973
- class: 'vxe-table--resizable-bar',
8974
- style: overflowX
8975
- ? {
8976
- 'padding-bottom': `${scrollbarHeight}px`
8977
- }
8978
- : null
9046
+ class: 'vxe-table--resizable-bar'
8979
9047
  }, resizableOpts.showDragTip
8980
9048
  ? [
8981
9049
  h('div', {
@@ -9164,18 +9232,39 @@ export default defineComponent({
9164
9232
  })
9165
9233
  })
9166
9234
 
9235
+ const reScrollFlag = ref(0)
9236
+ watch(computeSize, () => {
9237
+ reScrollFlag.value++
9238
+ })
9167
9239
  watch(() => props.showHeader, () => {
9168
- nextTick(() => {
9169
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
9170
- })
9240
+ reScrollFlag.value++
9171
9241
  })
9172
-
9173
9242
  watch(() => props.showFooter, () => {
9243
+ reScrollFlag.value++
9244
+ })
9245
+ watch(reScrollFlag, () => {
9174
9246
  nextTick(() => {
9175
9247
  tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
9176
9248
  })
9177
9249
  })
9178
9250
 
9251
+ const reLayoutFlag = ref(0)
9252
+ watch(() => props.height, () => {
9253
+ reLayoutFlag.value++
9254
+ })
9255
+ watch(() => props.maxHeight, () => {
9256
+ reLayoutFlag.value++
9257
+ })
9258
+ watch(computeScrollbarXToTop, () => {
9259
+ reLayoutFlag.value++
9260
+ })
9261
+ watch(computeScrollbarYToLeft, () => {
9262
+ reLayoutFlag.value++
9263
+ })
9264
+ watch(reLayoutFlag, () => {
9265
+ nextTick(() => tableMethods.recalculate(true))
9266
+ })
9267
+
9179
9268
  const footFlag = ref(0)
9180
9269
  watch(() => props.footerData ? props.footerData.length : -1, () => {
9181
9270
  footFlag.value++
@@ -9187,20 +9276,6 @@ export default defineComponent({
9187
9276
  tableMethods.updateFooter()
9188
9277
  })
9189
9278
 
9190
- watch(() => props.height, () => {
9191
- nextTick(() => tableMethods.recalculate(true))
9192
- })
9193
-
9194
- watch(() => props.maxHeight, () => {
9195
- nextTick(() => tableMethods.recalculate(true))
9196
- })
9197
-
9198
- watch(computeSize, () => {
9199
- nextTick(() => {
9200
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
9201
- })
9202
- })
9203
-
9204
9279
  watch(() => props.syncResize, (value) => {
9205
9280
  if (value) {
9206
9281
  handleUupdateResize()