node configure增改接近完成,删除后端还没做
This commit is contained in:
27
src/menu/index.js
Normal file
27
src/menu/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { uniqueId } from 'lodash'
|
||||
|
||||
/**
|
||||
* @description 给菜单数据补充上 path 字段
|
||||
* @description https://github.com/d2-projects/d2-admin/issues/209
|
||||
* @param {Array} menu 原始的菜单数据
|
||||
*/
|
||||
function supplementPath (menu) {
|
||||
return menu.map(e => ({
|
||||
...e,
|
||||
path: e.path || uniqueId('d2-menu-empty-'),
|
||||
...e.children ? {
|
||||
children: supplementPath(e.children)
|
||||
} : {}
|
||||
}))
|
||||
}
|
||||
|
||||
export const menuAside = supplementPath([
|
||||
{ path: '/index', title: '首页', icon: 'home' },
|
||||
{
|
||||
title: 'SCADA管理',
|
||||
children: [
|
||||
{ path: '/scada_configure', title: 'SCADA节点配置' },
|
||||
{ path: '/scada_query', title: 'SCADA数据查询' }
|
||||
]
|
||||
}
|
||||
])
|
||||
Reference in New Issue
Block a user