I'm building a fairly large app using Vue and I have a lot of routes, names and logic behind them. I found a great question/answer about Vue Router here and it gave me a lot of ideas, but I wasn't able to find an answer for myself. If I missed something, please feel free to point me in the right direction.
Here are my issues:
- Renaming hell: whenever I change a name of the route I have to go and find all the
self.$router.replace({ name: 'OldRouteName' })
and change them. Maybe it doesn't sound like a big deal, but it is, especially in a big project - Global guard hell: in a way it is related to the #1 where I'm relying on the text literals to analyze
from
andto
and call mynext({ name: 'RouteName', replace: true })
There are a few other minor things on the list, but those two are big for me.
My thought was to create a global object and store route names there something like Vue.prototype.$myRoutes = {Index:'Index', Home: 'Home'}
etc, but for some reason it doesn't feel right. I hope there is something better out there
Any help appreciated, thanks!