路由传递参数一般有两种方式:
- 在路由上添加key/value串使用,通过this.$route.query来获取
例如: :/router1?id=123
获取: this.$router.query.id
- 将参数作为路由一部分进行传参数,通过this.$route.params来获取
例如: /router2:id
获取:this.$route.params.id
路由传递参数一般有两种方式:
例如: :/router1?id=123
获取: this.$router.query.id
例如: /router2:id
获取:this.$route.params.id