Open mreall opened 4 years ago
Why not import router.js
where you want to access.. ? Don’t know..
That's certainly an option. As a workaround I also assigned it to Vue, i.e. Vue.prototype.$routes = routes
. But a logical place for it is with the Navigator.
It would really be helpful to have access to all the routes from the
$navigator
object. Right now we can only access the current route.This would be helpful, for example, if I want to define a default transition for each route in the meta object. Then when I call
this.$navigator.navigate
I can pass in the default transition for the route.routes.js example:
Then in a component used for routing: