vue3怎么获取当前路由最顶层路由对象?

比如我在角色管理页面,它怎么获取最顶层的父对象。
目前我就看见router.currentRoute.value.matched中,第一个是父。难道是这样取?
vue3怎么获取当前路由最顶层路由对象?

{

"name": "System",

"path": "/system",

"hidden": false,

"redirect": "noRedirect",

"component": "AdminLayout",

"alwaysShow": true,

"meta": {

"title": "管理后台",

"icon": "system",

"noCache": false,

"link": null

},

"children": [

{

"name": "User",

"path": "user",

"hidden": false,

"component": "system/user/index",

"meta": {

"title": "用户管理",

"icon": "user",

"noCache": false,

"link": null

}

},

{

"name": "Role",

"path": "role",

"hidden": false,

"component": "system/role/index",

"meta": {

"title": "角色管理",

"icon": "peoples",

"noCache": false,

"link": null

}

}

]

}

以上是 vue3怎么获取当前路由最顶层路由对象? 的全部内容, 来源链接: utcz.com/p/937515.html

回到顶部