router.push query 路由 跳转 传参使用

this.$router.push({path:'/shop',query:{
            goods_name:goods_name,
            goods_price:goods_price,
              uid:goods_price
            }})

 获取路由值

return{
            uid:sessionStorage.getItem('uid'), //获取session 值可忽略
            goods_name:this.$route.query.goods_name, //获取路由值
            goods_price:this.$route.query.goods_price,
          }

 router link 跳转 

<router-link to="apple"> to apple</router-link>

  

#  params 传参数 不在路由显示

this.$router.push({name:'添加工单',params:{
            id:item.id,
            name:item.name,
            desc:item.customfield
          
        }})

  

 goods_price:this.$route.params.id,

  

原文地址:https://www.cnblogs.com/zhangshijiezsj/p/13865702.html