vue中路由跳转后页面无数据问题

路由参数改变,页面数据不更新解决方法:

http://localhost:8080/#test?id=1

http://localhost:8080/#test?id=2,参数切换后,数据未更新

 

解决办法,亲测有效

 

 

 

watch: {    
        '$route' (to, from) {   
             this.$router.go(0);
             }
        }
methods:{
 clickBtn(item) {
      console.log("事件点击跳转");
      this.$router.push("/index?tabs=" + item);
    },
}

  

posted @ 2022-05-07 09:30  每天都是鑫的媛  阅读(701)  评论(0)    收藏  举报