码迷,mamicode.com
首页 > 其他好文 > 详细

react路由参数改变不重新渲染页面

时间:2018-07-16 19:25:30      阅读:553      评论:0      收藏:0      [点我收藏+]

标签:页面   history   解决办法   set   another   des   The   问题   tor   

  • 问题描述:
    从
    /test/1
    跳转到
    /test/2
    ,url改变了,页面没重新渲染
  • 解决办法(先跳转到其它页面,再跳转到目标页面):
    this.props.history.push("/another")
    var $this = this
    setTimeout(function(){
    $this.props.history.push("/destination/"+param)
    },100)
  • react路由参数改变不重新渲染页面

    标签:页面   history   解决办法   set   another   des   The   问题   tor   

    原文地址:http://blog.51cto.com/12173069/2145019

    (0)
    (0)
       
    举报
    评论 一句话评论(0
    登录后才能评论!
    © 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
    迷上了代码!