[Vuejs]-Vue Router not displaying template

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>

1👍

You made a typo in the routes:

path: '/dasboard',

Also, name for a route expects a string, not the component.

👤Ronald

Leave a comment