fix(components): [affix] positioning under KeepAlive cache (#23549)

* fix(components): [affix] positioning under KeepAlive cache

* Update packages/components/affix/src/affix.vue

Co-authored-by: rzzf <cszhjh@gmail.com>

---------

Co-authored-by: rzzf <cszhjh@gmail.com>
This commit is contained in:
E66
2026-01-29 16:53:12 +08:00
committed by GitHub
parent c3654150f2
commit d2e2ff3d59

View File

@@ -12,6 +12,8 @@
import {
computed,
nextTick,
onActivated,
onDeactivated,
onMounted,
ref,
shallowRef,
@@ -158,6 +160,14 @@ onMounted(() => {
updateRoot()
})
onActivated(() => {
nextTick(updateRootRect)
})
onDeactivated(() => {
fixed.value = false
})
useEventListener(scrollContainer, 'scroll', handleScroll)
watchEffect(update)