check a condition before all routing in vue router code example
Example: navbar route with params vue
//if we have a route that admits params via url:
{path : '/page/:id?', name='page', component: Page},
//we can edit the url to show the params we want like this:
<router-link :to="{name: 'page', params:{id: 'hello'}}"> </router-link>