3👍
Your routes should be defined as this
const routes = [{
path: '/',
component: Home
},
{
path: '/dashboard',
name: 'dashboard',
component: Dashboard
}
];
In your LandingPage.vue file write:
<router-link :to="{name:'dashboard'}">Dashboard</router-link>
- [Vuejs]-Passing functions as props to child components
- [Vuejs]-Vue router navigation gaurd from within the component
1👍
You made a typo in the routes:
path: '/dasboard',
Also, name
for a route expects a string, not the component.
Source:stackexchange.com