Open davestewart opened 2 months ago
Ah, it's router, but that function is not exactly a hook. You need to define it - https://github.com/vuejs/vitepress/pull/2564#issue-1783819597
router.onBeforeRouteChange = (to) => {
console.log('onBeforeRouteChange', to)
}
Aha! Yes, I think defo a docs issue.
Thanks for coming back so very quickly!!! 🥰
Describe the bug
The theme docs and code completion state that the
router
instance is exposed inenhanceApp()
but it appears therouter
instance is actually aroute
instance, and doesn't conform to the Router interface.Reproduction
Initialize a new project, then add the following code to
enhanceApp()
:Expected behavior
We should be able to interact with the
router
instanceSystem Info
Additional context
No response
Validations