我想用 vue js 在组件中显示子组件,但我不知道该怎么做。你能帮忙吗。当我从菜单中单击配置文件时,“http://localhost:3000/admin/profile”会登录。当我单击“ProfileDashboard”中的子菜单时,我希望打开子组件。我觉得像手风琴风格。
const routes = [
{
path: '/',
component: DashboardLayout,
redirect: '/admin/overview'
},
{
path: '/admin',
component: DashboardLayout,
redirect: '/admin/overview',
children: [
{
path: 'overview',
name: 'Overview',
component: Overview
},
{
path: 'profil',
name: 'Profil',
component: ProfilDashboard,
children: [
{
path: 'siparisgecmisi',
name: 'siparisgecmisi',
component: Gecmis
}
]
}
]
},
{path: '*', component: NotFound}
]
export default routes
ProfilDashboard.vue
<router-link to="/admin/profil/siparisgecmisi" tag="li" class="list-group-item"><a>My order history</a></router-link>