add beforeDeactivated
and beforeActivated
hook
#799
tbontb-iaq
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, we have
onMounted
andonBeforeMount
formount
, and the same applies toupdate
andunmount
. However, foractivate
anddeactivated
, we only haveonActivated
andonDeactivated
, lackingonBeforeActivate
andonBeforeDeactivate
.In vuejs/core#2349 (comment), I used
onDeactivated
to preserve the element's scroll position. However, by the time theonDeactivated
hook is triggered, the element has already been detached from the DOM, and itsscrollTop
andscrollLeft
are both 0.Beta Was this translation helpful? Give feedback.
All reactions