I want to use url parameters to set variables in my Vue application. I thought vue-router would be useful for that, but it seems to be all made for showing/hiding components inside a router-view component.
I'm considering using a single component without a template inside the router-view to set variables like this:
export default new Router({
routes: [
{
path: '/preferences',
name: 'Preferences',
component: Navigator,
props: { preferencesVisible: true }
},
{
path: '/info',
name: 'Info',
component: Navigator,
props: { infoVisible: true, preferencesVisible: false }
}
]
})
That way I could add additional logic that will define what components are visible as well as other things (e.g. app parameters that can be shared via links).
Are there reasons not to use vue-router this way? Are there better solutions to achieve this?