vue使用this.$router跳转路由与传值取值

本窗口打开:
  传参:
    this.$router.push({ name: 'info-detail', params: {id: id}})
  取参:
    this.$route.params.id
新窗口打开
  传参:
    window.open(this.$router.resolve({ path: 'info-detail', query: { id: id} }).href,  '_blank')
  取参:
    this.$route.query.id
posted @ 2021-06-08 14:52  爱就码上行动  阅读(561)  评论(0编辑  收藏  举报