ca-comp-sidebar
v1.0.10
Published
basic react component
Downloads
7
Readme
ca-comp-sidebar
API
| 属性 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | dataSource | 源数据 | Array | | | openKeys | 初始展开的 SubMenu 菜单项 key 数组 | Array | | | selectedKeys | 初始选中的菜单项 key 数组 | Array | |
Example
import React from 'react';
import { render } from 'react-dom';
import { Layout } from 'antd';
import Sidebar from 'ca-comp-sidebar';
const data = {
entries: [
{
title: '酒店业务',
key: 'hotel',
entries: [
{
title: '酒店产品',
key: 'key1',
link: 'link1.html'
},
{
title: '渠道运营',
key: 'key2',
link: 'link2.html'
},
{
title: '订单管理',
key: 'key3',
link: 'order.html'
}
]
},
{
title: '合作伙伴',
key: 'partner',
entries: [
{
title: '供应商管理',
key: 'key3',
link: 'link3.html'
},
{
title: '分销商管理',
key: 'key4',
link: 'link4.html'
}
]
}
],
openKeys: ['hotel'],
selectedKeys: ['key1']
};
render(
<Layout style={{height: '100vh'}}>
<Sidebar {...data} />
</Layout>,
document.getElementById('app')
);
Develop
$ npm run start
Publish
$ cd ../.. // 返回项目根目录,通过 `lerna` 来构建与发布
$ npm run build
$ npm publish