mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2025-11-12 14:27:49 +00:00
增加路由和material图标
This commit is contained in:
16
src/components/utils/index.js
Normal file
16
src/components/utils/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const calcWithIf = menuItem => {
|
||||
['icon', 'labelKey', 'label', 'html'].forEach(key => {
|
||||
const keyIf = menuItem[`${key}If`]
|
||||
if (keyIf) {
|
||||
menuItem[key] = keyIf(menuItem)
|
||||
}
|
||||
})
|
||||
}
|
||||
export const filterMenus = menus => menus.filter(menu => !menu.disabled)
|
||||
.map(menu => {
|
||||
calcWithIf(menu)
|
||||
if (menu.children && menu.children.length) {
|
||||
menu.children = filterMenus(menu.children)
|
||||
}
|
||||
return menu
|
||||
})
|
||||
Reference in New Issue
Block a user