? componentWillReceiveProps(nextProps) { //這是狀態發生變化是會調用該函數的意思嗎?? ? ? ? if (this.props.sign !== nextProps.sign) {//是如果本次的狀態和上次狀態不一樣時的意思嗎?? ? ? ? ? ? const user = nextProps.sign.get('user');//獲取本次輸入的用戶? ? ? ? ? ? if (user && user !== this.props.sign.get('user')) {? ? ? ? ? ? ? ? browserHistory.push('/console/')//這是什么意思?? ? ? ? ? ? } else if (nextProps.sign.has('signinError')) {? ? ? ? ? ? ? ? this.props.form.setFieldsValue({password: ''});//設置password控件的值為空? ? ? ? ? ? ? ? window.alert(nextProps.sign.getIn(['signinError', 'errMsg']));//彈出一個警示框顯示錯誤? ? ? ? ? ? }? ? ? ? }? ? }
我想問下這些代碼是什么意思?
慕碼人1183263
2016-10-25 22:34:20