1、使用router对象传递。
传参:

this.$router.push({name:"下一页面的路由name",params:{参数1:值1,参数2:Json.stringify(对象类型的值)}});
或者
this.$router.push({path:"/user/${userId}"});

接收参数:

this.$route.params.参数1
或
Json.parse(this.$route.params.参数2)
或
this.$route.params.userId

2、使用Storage对象传递,例如SessionStorage对象

sessionStorage.setItem("key",value);
sessionStorage.getItem("key");
sessionStorage.removeItem("key");

3、使用vuex传递参数
使用方式见Vue官方文档vuex组件使用https://vuex.vuejs.org/zh/guide/

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐