Quantcast
Channel: Exact path match in Vue router? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Exact path match in Vue router?

$
0
0

I am working on a Vue application and want to set up a exact path match for the default route. I have experience in React and Angular and both gave option exact and pathMatch:'full' so the default route only comes into action if it matches exactly.

In vue, when I refresh my app, the default route gets fired and takes the user back to the first page . Is there a way to do something like that in Vue?

  routes: [    {      path: "/",      name: "home",      component: Home      // how can I add exact match config here?    },    {      path: "/login",      name: "login",      component: () =>        import(/* webpackChunkName: "about" */ "./views/Login.vue")    },    {      path: "/charts",      name: "charts",      component: () =>        import(/* webpackChunkName: "about" */ "./views/ChartDemo.vue")    }  ]

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images