vue中路由以及动态路由跳转

 

路由跳转

第一种:

<router-link to='需要跳转到的页面的路径‘>
//浏览器在解析时,将它解析成一个类似于<a> 的标签。

第二种

this.$router.push({ path:'/user'})

动态路由(可传递参数)

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

获取路由参数

this.$route.query.productId

 

 

 

 

posted @ 2019-05-16 11:23  南瓜壳  阅读(4654)  评论(0编辑  收藏  举报