2019-01-12 03:33:27 +00:00
|
|
|
import Drawer from '../src/index';
|
|
|
|
import Menu from '../../menu/index';
|
|
|
|
import Icon from '../../icon/index';
|
|
|
|
import '../assets/index.less';
|
|
|
|
import '../../menu/style/index';
|
|
|
|
import '../../icon/style/index';
|
2018-09-05 13:28:54 +00:00
|
|
|
|
2019-01-12 03:33:27 +00:00
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
|
const MenuItemGroup = Menu.ItemGroup;
|
2018-09-05 13:28:54 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
methods: {
|
2019-01-12 03:33:27 +00:00
|
|
|
getContainer() {
|
|
|
|
return this.$refs.container;
|
2018-09-05 13:28:54 +00:00
|
|
|
},
|
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
2018-09-05 13:28:54 +00:00
|
|
|
return (
|
|
|
|
<div>
|
2019-01-12 03:33:27 +00:00
|
|
|
<div ref="container" />
|
|
|
|
<Drawer width="20vw" getContainer={this.getContainer}>
|
|
|
|
<Menu defaultSelectedKeys={['1']} defaultOpenKeys={['sub1']} mode="inline">
|
2018-09-05 13:28:54 +00:00
|
|
|
<SubMenu
|
2019-01-12 03:33:27 +00:00
|
|
|
key="sub1"
|
2018-09-05 13:28:54 +00:00
|
|
|
title={
|
|
|
|
<span>
|
2019-01-12 03:33:27 +00:00
|
|
|
<Icon type="mail" />
|
2018-09-05 13:28:54 +00:00
|
|
|
<span>Navigation One</span>
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
>
|
2019-01-12 03:33:27 +00:00
|
|
|
<MenuItemGroup key="g1" title="Item 1">
|
|
|
|
<Menu.Item key="1">Option 1</Menu.Item>
|
|
|
|
<Menu.Item key="2">Option 2</Menu.Item>
|
2018-09-05 13:28:54 +00:00
|
|
|
</MenuItemGroup>
|
2019-01-12 03:33:27 +00:00
|
|
|
<MenuItemGroup key="g2" title="Item 2">
|
|
|
|
<Menu.Item key="3">Option 3</Menu.Item>
|
|
|
|
<Menu.Item key="4">Option 4</Menu.Item>
|
2018-09-05 13:28:54 +00:00
|
|
|
</MenuItemGroup>
|
|
|
|
</SubMenu>
|
|
|
|
<SubMenu
|
2019-01-12 03:33:27 +00:00
|
|
|
key="sub2"
|
2018-09-05 13:28:54 +00:00
|
|
|
title={
|
|
|
|
<span>
|
2019-01-12 03:33:27 +00:00
|
|
|
<Icon type="appstore" />
|
2018-09-05 13:28:54 +00:00
|
|
|
<span>Navigation Two</span>
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
>
|
2019-01-12 03:33:27 +00:00
|
|
|
<Menu.Item key="5">Option 5</Menu.Item>
|
|
|
|
<Menu.Item key="6">Option 6</Menu.Item>
|
|
|
|
<SubMenu key="sub3" title="Submenu">
|
|
|
|
<Menu.Item key="7">Option 7</Menu.Item>
|
|
|
|
<Menu.Item key="8">Option 8</Menu.Item>
|
2018-09-05 13:28:54 +00:00
|
|
|
</SubMenu>
|
|
|
|
</SubMenu>
|
|
|
|
<SubMenu
|
2019-01-12 03:33:27 +00:00
|
|
|
key="sub4"
|
2018-09-05 13:28:54 +00:00
|
|
|
title={
|
|
|
|
<span>
|
2019-01-12 03:33:27 +00:00
|
|
|
<Icon type="setting" />
|
2018-09-05 13:28:54 +00:00
|
|
|
<span>Navigation Three</span>
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
>
|
2019-01-12 03:33:27 +00:00
|
|
|
<Menu.Item key="9">Option 9</Menu.Item>
|
|
|
|
<Menu.Item key="10">Option 10</Menu.Item>
|
|
|
|
<Menu.Item key="11">Option 11</Menu.Item>
|
|
|
|
<Menu.Item key="12">Option 12</Menu.Item>
|
2018-09-05 13:28:54 +00:00
|
|
|
</SubMenu>
|
|
|
|
</Menu>
|
|
|
|
</Drawer>
|
|
|
|
</div>
|
2019-01-12 03:33:27 +00:00
|
|
|
);
|
2018-09-05 13:28:54 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|