-
-
Notifications
You must be signed in to change notification settings - Fork 262
Expand file tree
/
Copy pathinlineCollapsed.tsx
More file actions
35 lines (33 loc) · 1.08 KB
/
inlineCollapsed.tsx
File metadata and controls
35 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { useState } from 'react';
import Menu, { SubMenu, Item } from 'rc-menu';
import './inlineCollapsed.less';
import { inlineMotion } from './antd'
const App = () => {
const [collapsed, setCollapsed] = useState(false);
return (
<div style={{ height: 600 }}>
<label>
<input type="checkbox" value={collapsed} onChange={e => setCollapsed(e.target.checked)} />
inlineCollapsed: {collapsed.toString()}
</label>
<Menu
mode="inline"
inlineCollapsed={collapsed}
style={{ width: 600 }}
className={collapsed ? 'collapsed' : ''}
motion={inlineMotion}
>
<Item key="1">item 1</Item>
<SubMenu key="2" title={`inlineCollapsed: ${collapsed.toString()}`}>
<Item key="3">item 2</Item>
<Item key="4">item 3</Item>
<SubMenu key="5" title={`inlineCollapsed: ${collapsed.toString()}`} style={{ minWidth: 220 }}>
<Item key="6">item 4</Item>
<Item key="7">item 5</Item>
</SubMenu>
</SubMenu>
</Menu>
</div>
);
}
export default App;