bomdeyada

Vue 有时在路由跳转时需要用到一些原页面里的数据,用以下方法:

1、在跳转页的方法里写下query参数

TableChange(scope){
          this.$router.push({
              path:\'details\',
              name:\'details\',
              query:{  //需要携带的参数
                  projectId:this.projectId,
                  projectName:this.projectName,
                  linkMan:this.linkMan,
                  phone:this.phone,
                  address:this.address,
                  builders:this.builders
              }
          })
      },

2、在目标页读取使用:

            this.$route.query

即可读取到传递过来的参数

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-05-11
  • 2021-11-28
  • 2021-07-19
  • 2021-11-03
  • 2021-11-28
  • 2021-11-28
  • 2021-11-29
猜你喜欢
  • 2021-11-28
  • 2021-11-03
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-11-27
  • 2021-11-22
相关资源
相似解决方案