Skip to content

Commit

Permalink
change bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dinglindong committed Jul 11, 2019
1 parent 43e1b04 commit 1803d94
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/react-init/pages/home/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import API from '@/react-init/api/api';

// 样式引入
import './home.less'

import { is, fromJS } from 'immutable';

@mixin({padStr})
class Home extends Component {
Expand Down Expand Up @@ -107,7 +107,14 @@ class Home extends Component {
alertTip: '',
})
}
// 初始化数据,获取已选择的商品

componentWillReceiveProps(nextProps){
if(!is(fromJS(this.props.proData), fromJS(nextProps.proData))){
this.initData(nextProps);
}
}

// 初始化数据,获取已选择的商品
initData = props => {
this.selectedProList = [];
props.proData.dataList.forEach(item => {
Expand Down

0 comments on commit 1803d94

Please sign in to comment.