VUE使用params隐藏参数,不在地址栏中显示传的参数

VUE跳转页面传值 地址栏显示传值或者不显示地址栏传值
a页面传值到b页面
params 传参 : 相当于post请求,页面跳转时参数不会在地址栏中显示

this.$router.push({

name:'',

params: { id:idParams }

})

接收参数:this.$route.params.id

query 传参 : 相当于get请求,页面跳转时参数会在地址栏中显示

this.$router.push({

name:'',

query: { id:idParams }

})

接收参数:this.$route.query.id

注意:传参是 router , 接收参数是 route

 

转自:https://blog.csdn.net/weixin_43836052/article/details/95166345

posted @ 2020-03-25 13:08  白玲  阅读(7963)  评论(0编辑  收藏  举报