import './demo8.css'; import Box from '../../box'; import Menu from '..'; import React from 'react'; import ReactDOM from 'react-dom'; const { PopupItem, Divider } = Menu; const popupProps = { align: 'tc bc', triggerType: 'click', }; const ds = [ { title: '库存管理', children: [ { title: '部门库存管理', link: '', }, { title: '小二库存管理', link: '', }, ], }, { title: '功能模块管理', children: [ { title: '功能模块管理', link: '', }, { title: '卡片管理', link: '', }, { title: '首页布局', link: '', }, { title: '页面管理', link: '', }, ], }, { title: '系统管理', children: [ { title: '角色管理', link: '', }, { title: '标签管理', link: '', }, { title: '字典管理', link: '', }, ], }, ]; const Panel = props => { const { dataSource, ...others } = props; return (
{dataSource.map((item, i) => { return (
{item.title}
{item.dataSource.map((child, g) => { const a = child.children && child.children.map((c, j) => { return ( {c.title} ); }); return [
{child.title}
, ...a, ]; })}
); })}
); }; const SubPanel = props => { const { dataSource, ...others } = props; return (
{dataSource.map((item, i) => { return (
{item.title}
{item.children.map((child, j) => { return ( {child.title} ); })}
); })}
); }; ReactDOM.render( { const newDs = more.map(item => { const data = item.props.children.props; return { title: item.props.label, dataSource: data.dataSource, }; }); return ( ); }} > , document.getElementById('menu-demo-8'), );