我正在研究Vue Router。我有个问题。当我访问父组件(SettingProfile)
时,我将不会重定向到第一个子组件(settings)
。
期望网址:localhost:8080/settings
-> localhost:8080/settings/profile
这是我的路由器:
{
name: 'settings',
path: '/settings',
component: () => import('./views/settings.vue'),
children: [
{
path: 'profile',
name: 'SettingProfile',
component: () => import('./components/settings/profile.vue')
},
{
path: 'account',
name: 'account',
component: () => import('./components/settings/account.vue')
}
]
},
答案 0 :(得分:2)