From 5944c2832820a8bfa86e3efb5085f5a2463897f9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 22 九月 2020 09:14:49 +0800 Subject: [PATCH] 2020-09-22 --- src/menu/actioncomponent/index.jsx | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/menu/actioncomponent/index.jsx b/src/menu/actioncomponent/index.jsx index a1073ac..2e1b8b1 100644 --- a/src/menu/actioncomponent/index.jsx +++ b/src/menu/actioncomponent/index.jsx @@ -1,5 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' +import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Modal, notification, Button } from 'antd' import moment from 'moment' @@ -26,7 +27,6 @@ class ActionComponent extends Component { static propTpyes = { type: PropTypes.string, // 鑿滃崟绫诲瀷锛屼富琛ㄦ垨瀛愯〃 - menu: PropTypes.object, // 鑿滃崟淇℃伅锛堣彍鍗昳d锛岃彍鍗曞弬鏁帮紝鑿滃崟鍚嶇О锛� config: PropTypes.object, // 鑿滃崟閰嶇疆淇℃伅 tabs: PropTypes.array, // 鎵�鏈夋爣绛� setSubConfig: PropTypes.func, // 璁剧疆瀛愰厤缃俊鎭� @@ -877,7 +877,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) + return !is(fromJS(this.props.config), fromJS(nextProps.config)) || !is(fromJS(this.state), fromJS(nextState)) } /** @@ -982,4 +982,14 @@ } } -export default ActionComponent \ No newline at end of file +const mapStateToProps = (state) => { + return { + menu: state.customMenu + } +} + +const mapDispatchToProps = () => { + return {} +} + +export default connect(mapStateToProps, mapDispatchToProps)(ActionComponent) \ No newline at end of file -- Gitblit v1.8.0