mirror of
https://github.com/element-plus/element-plus.git
synced 2026-02-04 10:33:11 +08:00
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:
@@ -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,
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user