Как мне перенаправить, если путь «/» или «/ логин». Я думал о добавлении другого объекта с '/', и компонент все равно будет входить в систему, но я не знаю, правильно ли это. Вот мой роутер.
const router = new Router({
mode: 'history',
linkExactActiveClass: 'active',
routes: [
{
name: 'dashboard',
path: '/dashboard',
component: Dashboard,
meta: {
requiresAuth: true
}
},
{
name: 'profile',
path: '/profile',
component: Profile,
meta: {
requiresAuth: true
}
},
{
name: 'login',
path: '/login',
component: Login,
meta: {
requiresVisitor: true
}
},
{
name: 'logout',
path: '/logout',
component: Logout,
meta: {
requiresAuth: true
}
}
]
});