数据结构如下:
const filterData = [
{
"authKey": "terminal",
"children": [
{
"authKey": "manufacturer",
"index": 2,
"name": "厂商信息管理",
"type": 1
}
],
"index": 5,
"name": "终端管理",
"type": 1
},
{
"authKey": "receiveAccount",
"children": null,
"index": 0,
"name": "收款账户管理",
"type": 1
}
]
const route = [
{
path: '/account',
name: 'account',
redirect: '/account/receiveAccount',
children: [
{
path: 'receiveAccount',
component: () => import('@/views/account-manage/receive-account/receive-account.vue'),
name: 'receiveAccount',
meta: {
icon: 'receive-account',
title: '收款账户管理',
authKey: 'receiveAccount'
}
}
]
},
{
path: '/terminal',
name: 'terminal',
redirect: '/terminal/terminalInfo',
alwaysShow: true,
meta: {
icon: 'terminal',
title: '终端管理',
authKey: 'terminal'
},
children: [
{
path: 'terminalInfo',
component: () => import('@/views/terminal-manage/terminal-info/terminal-info.vue'),
name: 'terminalInfo',
meta: {
title: '终端信息管理',
icon: 'terminal',
authKey: 'terminalInfo'
}
},
{
path: 'manufacturerInfo',
component: () => import('@/views/terminal-manage/manufacturer-info/manufacturer-info.vue'),
name: 'manufacturerInfo',
meta: {
title: '厂商信息管理',
icon: 'manufacturer',
authKey: 'manufacturer'
}
}
]
}
]
请问如何以filterData中的authkey为筛选条件,并且按照filterData的顺序结构,过滤出route中相匹配的数据(route中有符合条件的子数据,上级也保留)
请问解决这个问题了吗