fix(components): [table-v2] use keep-alive position top error (#20813)

* fix(components): [table-v2] use `keep-alive` position top error

* chore: del useless code

* chore: del useless code

* chore: add nextTick
This commit is contained in:
sea
2025-05-22 10:30:59 +08:00
committed by GitHub
parent 040520dddf
commit 5905ab430a

View File

@@ -2,6 +2,8 @@ import {
computed,
defineComponent,
inject,
nextTick,
onActivated,
provide,
ref,
unref,
@@ -175,6 +177,12 @@ const TableGrid = defineComponent({
provide('tableV2GridScrollLeft', scrollLeft)
onActivated(async () => {
await nextTick()
const scrollTop = bodyRef.value?.states.scrollTop
scrollTop && scrollToTop(Math.round(scrollTop) + 1)
})
expose({
forceUpdate,
/**