--- order: 5 title: zh-CN: 切换菜单类型 en-US: Switch the menu type --- ## zh-CN 展示动态切换模式。 ## en-US Show the dynamic switching mode (between 'inline' and 'vertical'). ````jsx import { Menu, Icon, Switch } from 'antd'; const SubMenu = Menu.SubMenu; const MenuItemGroup = Menu.ItemGroup; class Sider extends React.Component { state = { mode: 'inline', } changeMode = (value) => { this.setState({ mode: value ? 'vertical' : 'inline', }); } render() { return (


Navigation One}> Option 1 Option 2 Option 3 Option 4 Navigation Two}> Option 5 Option 6 Option 7 Option 8 Navigation Three}> Option 9 Option 10 Option 11 Option 12
); } } ReactDOM.render(, mountNode); ````