vue this.$router.push 傳參小坑

query傳參,用的是path,而不是name,否則也會出錯。

this.$router.push({path:'/Goods',query:{goodsId:id}})

params傳參,用的是name,而不是path,否則也會出錯。

this.$router.push({name:'Goods',params:{goodsId:id}})
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章