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
