From df1b53130fd9938cad9e71204fb858c46113372d Mon Sep 17 00:00:00 2001 From: pmg1989 <972401854@qq.com> Date: Thu, 16 Mar 2017 14:36:58 +0800 Subject: [PATCH 1/2] fix menu style --- src/components/layout/main.less | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/layout/main.less b/src/components/layout/main.less index 5e4bc9e..a3cac6e 100644 --- a/src/components/layout/main.less +++ b/src/components/layout/main.less @@ -157,12 +157,14 @@ &.ant-menu-vertical { .ant-menu-sub { + height: 0; opacity: 0; - transition: none; + overflow: hidden; } - + .ant-menu-submenu-active { .ant-menu-sub { + height: auto; opacity: 1; } } From 6ab878061dffb3c9568ed49941745123642404c8 Mon Sep 17 00:00:00 2001 From: pmg1989 <972401854@qq.com> Date: Thu, 16 Mar 2017 14:58:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E6=A0=8F=E8=8F=9C=E5=8D=95=E5=9C=A8key=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BC=9A=E5=90=8C=E6=97=B6=E9=80=89=E4=B8=AD?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/main.less | 4 ++-- src/components/layout/menu.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/layout/main.less b/src/components/layout/main.less index a3cac6e..55c8604 100644 --- a/src/components/layout/main.less +++ b/src/components/layout/main.less @@ -159,9 +159,9 @@ .ant-menu-sub { height: 0; opacity: 0; - overflow: hidden; + transition: none; } - + .ant-menu-submenu-active { .ant-menu-sub { height: auto; diff --git a/src/components/layout/menu.js b/src/components/layout/menu.js index 925bdc5..ad131b4 100644 --- a/src/components/layout/menu.js +++ b/src/components/layout/menu.js @@ -4,19 +4,19 @@ import { Link } from 'dva/router' import { menu } from '../../utils' const topMenus = menu.map(item => item.key) -const getMenus = function (menuArray, siderFold, parentPath) { - parentPath = parentPath || '/' +const getMenus = function (menuArray, siderFold, parentPath = '/') { return menuArray.map(item => { + const linkTo = parentPath +item.key if (item.child) { return ( -