官网:https://router.vuejs.org/zh/
常见问题
1、vue怎么跳转某个路由,并传递参数。
使用以下代码跳转目标路由:
this.$router.push({
path: "/map/onemap/index",
query: {
stationId: "12345",
},
});
在目标页面用以下代码获取传递的参数:
this.$route.query.stationId
官网:https://router.vuejs.org/zh/
1、vue怎么跳转某个路由,并传递参数。
使用以下代码跳转目标路由:
this.$router.push({
path: "/map/onemap/index",
query: {
stationId: "12345",
},
});
在目标页面用以下代码获取传递的参数:
this.$route.query.stationId
一个来自三线小城市的程序员开发经验总结。