1. 页面跳转路由的时候,传值this.$router.push({name : 'content' , params : person})
2. 跳到content页面 , 在content页取值,用this.$route.parmas取值就可以了
打印出来得结果是
3. this.$route.parmas.name 就是大毛
this.$route.parmas.age 就是12
注意:跳转路由的时候是router,取值的时候是route
1. 页面跳转路由的时候,传值this.$router.push({name : 'content' , params : person})
2. 跳到content页面 , 在content页取值,用this.$route.parmas取值就可以了
打印出来得结果是
3. this.$route.parmas.name 就是大毛
this.$route.parmas.age 就是12
注意:跳转路由的时候是router,取值的时候是route