diff --git a/src/components/Layout/GlobalNav/Left/index.jsx b/src/components/Layout/GlobalNav/Left/index.jsx index 62144c87..e5dd7a26 100644 --- a/src/components/Layout/GlobalNav/Left/index.jsx +++ b/src/components/Layout/GlobalNav/Left/index.jsx @@ -21,7 +21,10 @@ import styles from './index.less'; export default class Left extends React.Component { static propTypes = { - items: PropTypes.arrayOf(navItemPropType), + items: PropTypes.oneOfType([ + PropTypes.arrayOf(navItemPropType), + PropTypes.array, + ]), onClose: PropTypes.func, }; diff --git a/src/components/Layout/GlobalNav/Right/index.jsx b/src/components/Layout/GlobalNav/Right/index.jsx index 2d40533b..1be888e2 100644 --- a/src/components/Layout/GlobalNav/Right/index.jsx +++ b/src/components/Layout/GlobalNav/Right/index.jsx @@ -24,7 +24,10 @@ const { Search } = Input; export default class Right extends React.Component { static propTypes = { - items: PropTypes.arrayOf(navItemPropType), + items: PropTypes.oneOfType([ + PropTypes.arrayOf(navItemPropType), + PropTypes.array, + ]), onClose: PropTypes.func, }; @@ -98,7 +101,7 @@ export default class Right extends React.Component { const { name = '' } = item || {}; return ( -
+
{name}
{this.renderNavItemChildren(item)} diff --git a/src/components/Layout/GlobalNav/Right/index.less b/src/components/Layout/GlobalNav/Right/index.less index f38b8a8b..a4dd302b 100644 --- a/src/components/Layout/GlobalNav/Right/index.less +++ b/src/components/Layout/GlobalNav/Right/index.less @@ -28,6 +28,10 @@ line-height: 32px; cursor: pointer; + a { + display: block; + } + &:hover { background-color: rgba(0, 0, 0, 5%); } diff --git a/src/components/Layout/GlobalNav/index.jsx b/src/components/Layout/GlobalNav/index.jsx index b6f6e739..ff387057 100644 --- a/src/components/Layout/GlobalNav/index.jsx +++ b/src/components/Layout/GlobalNav/index.jsx @@ -26,7 +26,10 @@ import styles from './index.less'; export class GlobalNav extends React.Component { static propTypes = { - navItems: PropTypes.arrayOf(navItemPropType), + navItems: PropTypes.oneOfType([ + PropTypes.arrayOf(navItemPropType), + PropTypes.array, + ]), }; static defaultProps = {