使用dva时,通过subscriptions中的setUp,根据路由去请求数据时,在setup函数结束时,页面上componentDidMount并不一定已经执行完,因为dispatch是异步执行,因此,如果想给state重新赋值,要使用componentWillRecieiveProps中使用setState

posted on 2019-08-11 13:11  zhouyu0001  阅读(2853)  评论(0编辑  收藏  举报