mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(components): [table-v2] endReached triggered twice when first (#11928)
This commit is contained in:
parent
a99bc4fb49
commit
406ac68fc8
@ -1,11 +1,4 @@
|
||||
import {
|
||||
computed,
|
||||
getCurrentInstance,
|
||||
ref,
|
||||
shallowRef,
|
||||
unref,
|
||||
watch,
|
||||
} from 'vue'
|
||||
import { computed, getCurrentInstance, ref, shallowRef, unref } from 'vue'
|
||||
import { debounce } from 'lodash-unified'
|
||||
import { isNumber } from '@element-plus/utils'
|
||||
import { FixedDir } from '../constants'
|
||||
@ -28,13 +21,11 @@ type UseRowProps = {
|
||||
mainTableRef: GridInstanceRef
|
||||
leftTableRef: GridInstanceRef
|
||||
rightTableRef: GridInstanceRef
|
||||
|
||||
onMaybeEndReached: () => void
|
||||
}
|
||||
|
||||
export const useRow = (
|
||||
props: TableV2Props,
|
||||
{ mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }: UseRowProps
|
||||
{ mainTableRef, leftTableRef, rightTableRef }: UseRowProps
|
||||
) => {
|
||||
const vm = getCurrentInstance()!
|
||||
const { emit } = vm
|
||||
@ -148,8 +139,6 @@ export const useRow = (
|
||||
flushingRowHeights()
|
||||
}
|
||||
}
|
||||
// when rendered row changes, maybe reaching the bottom
|
||||
watch(lastRenderedRowIndex, () => onMaybeEndReached())
|
||||
|
||||
return {
|
||||
hoveringRowKey,
|
||||
|
@ -60,8 +60,6 @@ function useTable(props: TableV2Props) {
|
||||
mainTableRef,
|
||||
leftTableRef,
|
||||
rightTableRef,
|
||||
|
||||
onMaybeEndReached,
|
||||
})
|
||||
|
||||
const { data, depthMap } = useData(props, {
|
||||
|
Loading…
Reference in New Issue
Block a user