From 35481059b5089933b98775f517bb261c60cd5ac4 Mon Sep 17 00:00:00 2001 From: chenhf <4019980@qq.com> Date: Fri, 14 Oct 2016 16:39:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=9E=84?= =?UTF-8?q?=E6=97=B6server=E3=80=81client=E7=9A=84render=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SubMenu.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SubMenu.jsx b/src/SubMenu.jsx index dadb46c3..46d95e51 100644 --- a/src/SubMenu.jsx +++ b/src/SubMenu.jsx @@ -1,7 +1,6 @@ import SubPopupMenu from './SubPopupMenu'; import React, { PropTypes } from 'react'; import KeyCode from 'rc-util/lib/KeyCode'; -import guid from 'rc-util/lib/guid'; import classnames from 'classnames'; import { noop, loopMenuItemRecusively } from './util'; @@ -48,6 +47,7 @@ const SubMenu = React.createClass({ getInitialState() { this.isSubMenu = 1; + this._menuId = this.props.key || Date.now() return { defaultActiveFirst: false, }; @@ -381,7 +381,6 @@ const SubMenu = React.createClass({ classes[this.getDisabledClassName()] = props.disabled; classes[this.getSelectedClassName()] = this.isChildrenSelected(); - this._menuId = this._menuId || guid(); classes[prefixCls] = true; classes[`${prefixCls}-${props.mode}`] = 1; let titleClickEvents = {}; From 685f7f0a5d8beefb5e6e92667b7d190ed15c7282 Mon Sep 17 00:00:00 2001 From: chenhf <4019980@qq.com> Date: Mon, 17 Oct 2016 10:44:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=9E=84?= =?UTF-8?q?=E6=97=B6server=E3=80=81client=E7=9A=84render=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SubMenu.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SubMenu.jsx b/src/SubMenu.jsx index 46d95e51..96ac4b6a 100644 --- a/src/SubMenu.jsx +++ b/src/SubMenu.jsx @@ -10,6 +10,7 @@ const SubMenu = React.createClass({ propTypes: { parentMenu: PropTypes.object, title: PropTypes.node, + key: PropTypes.string, children: PropTypes.any, selectedKeys: PropTypes.array, openKeys: PropTypes.array, @@ -47,7 +48,7 @@ const SubMenu = React.createClass({ getInitialState() { this.isSubMenu = 1; - this._menuId = this.props.key || Date.now() + this._menuId = this.props.key || Date.now(); return { defaultActiveFirst: false, };