Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onBeforeActivate and onBeforeDeactivate hook #1518

Closed
danyadev opened this issue Jul 6, 2020 · 3 comments
Closed

add onBeforeActivate and onBeforeDeactivate hook #1518

danyadev opened this issue Jul 6, 2020 · 3 comments
Labels
✨ feature request New feature or request

Comments

@danyadev
Copy link

danyadev commented Jul 6, 2020

What problem does this feature solve?

  1. onActivated and onDeactivated are the only hooks that have no option with the Before prefix.

  2. I need onBeforeDeactivate to maintain the scroll position when closing or switching between components. In a little more detail I described this in another issue.

What does the proposed API look like?

onBeforeActivate(() => console.log('call #1'));
onActivated(() => console.log('call #2'));
onBeforeDeactivate(() => console.log('call #3'));
onDeactivated(() => console.log('call #4'));
@yyx990803 yyx990803 added the ✨ feature request New feature or request label Jul 6, 2020
@Hisioni
Copy link

Hisioni commented Jul 14, 2020

why not use vue-router hooks

@eolme
Copy link
Contributor

eolme commented Jul 28, 2020

why not use vue-router hooks

Why do I need vue-router to switch 2 components?

@HcySunYang
Copy link
Member

Closed, tracking here vuejs/rfcs#284

@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants