diff --git a/components/menu/__tests__/__snapshots__/demo.test.js.snap b/components/menu/__tests__/__snapshots__/demo.test.js.snap index f29466ffeb..191f34d012 100644 --- a/components/menu/__tests__/__snapshots__/demo.test.js.snap +++ b/components/menu/__tests__/__snapshots__/demo.test.js.snap @@ -278,6 +278,20 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` class="ant-switch-inner" /> + Change Mode + + + + + Change Theme

@@ -381,33 +388,13 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` aria-owns="sub2$Menu" class="ant-menu-submenu-title" style="padding-left:24px;" - > - - - - Navigation Two - - - - -
  • - diff --git a/components/menu/demo/switch-mode.md b/components/menu/demo/switch-mode.md index fd46756de8..24ea7de1b3 100755 --- a/components/menu/demo/switch-mode.md +++ b/components/menu/demo/switch-mode.md @@ -15,52 +15,59 @@ Show the dynamic switching mode (between 'inline' and 'vertical'). ````jsx import { Menu, Icon, Switch } from 'antd'; -const SubMenu = Menu.SubMenu; -const MenuItemGroup = Menu.ItemGroup; +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}> - - Option 1 - Option 2 - - - Option 3 - Option 4 - - - Navigation Two}> - Option 5 - Option 6 - - Option 7 - Option 8 + + + Navigation One + + + + Navigation Two + + Navigation Three}> + Option 3 + Option 4 + + Option 5 + Option 6 - Navigation Three}> + Navigation Four}> + Option 7 + Option 8 Option 9 Option 10 - Option 11 - Option 12