Vue路由带参
文章目录
URL: /AAA/id
传参:this.$router.push("/AAA/" + id);
路由:path: '/AAA/:id',
获取:this.id = this.$route.params.id;
URL: /BBB?id=id
传参:this.$router.push({ path: "/BBB", query: { id: id } });
路由:path: '/BBB',
获取:this.id = this.$route.query.id;
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论