vue中的router

163 阅读1分钟

我想在当前页面传值到另一个页面去

   1,地址栏不可见传值(post)

当前的页面

this.$router.push({ name: 'dashboard', params: { id: 5 } })

将要跳转的页面

this.a = this.$route.params

此时的a是


地址栏是



 2,地址栏可见传值(get)

当前的页面

this.$router.push({ path: '/dashboard', query: { id: 5 } })

将要跳转的页面

this.a = this.$route.query

此时的a是