vue-router2路由参数注意问题

1、vue 路由 如果传递 params 定义路由的时候是

 /路由名称:id

获取的时候 

this.$route.params.id

最后形如

   /路由名称/路由参数

传参的时候

params:{
    str1:str1,
    str2:str2  
}


2、如果传递query ?id=str.... 定义路由的时候直接是

 /路由名称

获取的时候

 this.$route.query.id

传参的时候

data:{
    str1:str1,
    str2:str2  
}



原文地址:https://www.cnblogs.com/beileixinqing/p/7794533.html