vue router change page function code example
Example 1: vue redirect to route
// Use this in a lifecycle method
this.$router.push('/login');
Example 2: 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>