You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/menu/demo/theme.md
+29-8
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ title:
11
11
12
12
## en-US
13
13
14
-
There are two built-in themes: `light` and `dark`. The default value is `light`.
14
+
There are two built-in themes: `light` and `dark`. The default value is `light`. They can be applied to the `Menu`, and the Sub-menu will inherit this, or you can override at the `SubMenu` level
15
15
16
16
```jsx
17
17
import { Menu, Switch } from'antd';
@@ -21,13 +21,20 @@ const { SubMenu } = Menu;
21
21
22
22
classSiderextendsReact.Component {
23
23
state = {
24
-
theme:'dark',
24
+
menuTheme:'dark',
25
+
subMenuTheme:'dark',
25
26
current:'1',
26
27
};
27
28
28
-
changeTheme=value=> {
29
+
changeMenuTheme=value=> {
29
30
this.setState({
30
-
theme: value ?'dark':'light',
31
+
menuTheme: value ?'dark':'light',
32
+
});
33
+
};
34
+
35
+
changeSubMenuTheme=value=> {
36
+
this.setState({
37
+
subMenuTheme: value ?'dark':'light',
31
38
});
32
39
};
33
40
@@ -41,23 +48,37 @@ class Sider extends React.Component {
0 commit comments