Vue|触发路由跳转

标签方式跳转

 <router-link :to="{path:'/',query: {id: 'testQuery'}}">返回列表测试Query</router-link>

脚本方式跳转

  1. this.$router.push({ name: 'productIndex',params: { id: "testParams" } })
  2. this.$router.push({ path: `product/detail/${row.id}`})
  3. this.$router.push({ path: 'product/xxxx',query: { id: "testParams" } })

productIndex:路由名称

params:传出参

获取传入参数

  1. console.log(this.$route.params);
  2. console.log(this.$route.query);

 

posted @ 2021-07-22 15:52  未来可期_Durant  阅读(46)  评论(0编辑  收藏  举报