vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.88k stars 1.18k forks source link

Add `onBeforeRouteEnter` API to the list of composition API #1517

Closed ahnpnl closed 2 years ago

ahnpnl commented 2 years ago

What problem does this feature solve?

Current the documentation about composition API https://router.vuejs.org/guide/advanced/navigation-guards.html#using-the-composition-api doesn't mention about onBeforeRouteEnter. I see in Options API, there is beforeRouteEnter hence there should be one for composition API too.

What does the proposed API look like?

export function onBeforeRouteUpdate(to, from) {
      //....
}
posva commented 2 years ago

onBeforeRouteEnter() doesn't exist, it's not possible to implement such guard with the composition api.

a798032825 commented 2 years ago

onBeforeRouteEnter() doesn't exist, it's not possible to implement such guard with the composition api.

hello,may I get a case to put beforeRouteEnter into Githubissues.

  • Githubissues is a development platform for aggregating issues.