--- 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, Switch } from 'antd'; import { Mail, Calendar, Appstore, Setting } from '@ant-design/icons'; const { SubMenu } = Menu; class Sider extends React.Component { state = { mode: 'inline', theme: 'light', }; changeMode = value => { this.setState({ mode: value ? 'vertical' : 'inline', }); }; changeTheme = value => { this.setState({ theme: value ? 'dark' : 'light', }); }; render() { return (
Change Mode Change Theme

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