[Vuejs]-Vue router beforeEach

0👍

assuming that you have router.js file or something similar your route object would look something like this

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login', // this being the name
      component: () => import(whatever component),
      meta: {
       // some data goes here if needed
      }
    },
  ]
})

name: 'login' would be the undefined value you are seeing or what ever name you place there for whatever route

Leave a comment