vue router 传递参数

vue-router 传参的方式 query 和params

query 类似于get请求的传参方法 就是 ? 这种形式的 https://i.cnblogs.com/EditPosts.aspx?opt=1

今天发现了个重要的问题  

params传递参数的时候不能用path跳转 , 可以用name

this.$router.push({ name: '审批主页',params:item})  这种的可以传过去
但是this.$router.push({ path: '/xxx',params:item})  这种就不行
 

猜你喜欢

转载自www.cnblogs.com/sunjinggege/p/9559333.html
今日推荐