跳转到home.vue页面:this.$router.push({name:'Home'})
或者this.$router.push({path:'/home'})
this.$router.push({name:'Home',params:{id:data.id}) 还需要传参的话刷新时会丢失参数相对安全
还需要传参的话 this.$router.push({path:'/home',query:{id:data.id}) 刷新时不会丢失参数,传参信息会出现在地址栏上 ,不安全.
接受query传过来的内容:this.$route.query.xxx
![](https://img.haomeiwen.com/i16899108/8adb75ea9bdf0658.png)
接受params传过来的内容:this.$route.params.xxx
网友评论