一 、正向傳值
傳: Actions.ComponetKey({key:value})
接: 在組件的prop里通過key直接拿
? ? ? ? ? ? constructor(props){
? ? ? ? ? ? ? ? console.log(props.key)
????????????}
? ? ? ? ???componentDidMount(props){
? ? ? ? ? ? ? ? console.log(props.key)
????????????}
二 酷勺、反向傳值
傳:Actions.pop({refresh:{key:value}})
? ? ? ? Actions.pop({popNum:num, refresh:{key:value}})
接:只能在componentWillReceiveProps里接受
? ??????componentWillReceiveProps(nextProps){
? ? ? ? ? ? ? ? console.log(nestProps.key)
????????}
? ? ?注: refresh觸發(fā)componentWillReceiveProps, 不傳refresh不會觸發(fā)componentWillReceiveProps