var?data?=?[
{
path:?'/home',
name:?'首頁(yè)'
},
{
name:?'系統(tǒng)組件',
child:?[
{
name:?'介紹',
path:?'/components'
},
{
name:?'功能類',
path:?'/components',
child:?[
{
path:?'/components/permission',
name:?'詳細(xì)鑒權(quán)'
},
{
path:?'/components/pageTable',
name:?'表格分頁(yè)'
}
]
},
{
name:?'輔助類',
child:?[
{
path:?'/components/pageNotes',
name:?'引用說(shuō)明'
}
]
}
]
},
{
name:?'完整示例',
child:?[
{
path:?'/example/table',
name:?'列表頁(yè)面',
permission:?['list/edit','list/query','list/add','list/delete']
}
]
},
{
path:?'/i18n',
name:?'國(guó)際化'
},
{
path:?'/theme',
name:?'主題切換'
}
]var?partdata?=?[
{
name:'list/edit'
},
{
name:'list/query'
},
{
path:?'/i18n',
name:?'國(guó)際化'
},
{
path:?'/theme',
name:?'主題切換'
}
]data是一張完整的路由表,然后需要根據(jù)partdata的數(shù)據(jù)來(lái)將完整的進(jìn)行篩選,如果partdata中有的,這一項(xiàng)的所有父級(jí)都需要保留,如果這一項(xiàng)沒有跟partdata無(wú)關(guān),就需要?jiǎng)h除,最終只保留具有partdata的路由表
急急急,誰(shuí)能搞出來(lái)我發(fā)紅包好吧?。。?!
西蘭花偉大炮
2018-03-18 18:12:28