标签方式跳转
<router-link :to="{path:'/',query: {id: 'testQuery'}}">返回列表测试Query</router-link>
脚本方式跳转
- this.$router.push({ name: 'productIndex',params: { id: "testParams" } })
- 或
- this.$router.push({ path: `product/detail/${row.id}`})
- 或
- this.$router.push({ path: 'product/xxxx',query: { id: "testParams" } })
productIndex:路由名称
params:传出参
获取传入参数
- console.log(this.$route.params);
- console.log(this.$route.query);