From 0c95751b8d3bffa96d3162fc3c789db78be2282f Mon Sep 17 00:00:00 2001 From: Louis-7 Date: Mon, 3 Sep 2018 14:54:20 +0800 Subject: [PATCH] restrict rule Signed-off-by: Louis-7 --- src/components/Layout/Layout.less | 8 ++++++++ src/components/Layout/Menu.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/components/Layout/Layout.less b/src/components/Layout/Layout.less index bf5adc4..f6098ca 100644 --- a/src/components/Layout/Layout.less +++ b/src/components/Layout/Layout.less @@ -108,6 +108,14 @@ } } +.sidemenu { + :global{ + .ant-menu-item { + width: 100%; + } + } +} + .switchtheme { width: 100%; position: absolute; diff --git a/src/components/Layout/Menu.js b/src/components/Layout/Menu.js index 0ce46ab..9c0ce1e 100644 --- a/src/components/Layout/Menu.js +++ b/src/components/Layout/Menu.js @@ -4,6 +4,7 @@ import { Menu, Icon } from 'antd' import { Link } from 'react-router-dom' import { arrayToTree, queryArray } from 'utils' import pathToRegexp from 'path-to-regexp' +import styles from './Layout.less' const { SubMenu } = Menu let openKeysFlag = false @@ -123,6 +124,7 @@ const Menus = ({ mode={siderFold ? 'vertical' : 'inline'} theme={darkTheme ? 'dark' : 'light'} selectedKeys={defaultSelectedKeys} + className={styles.sidemenu} > {menuItems}