路由传参 点击查询携带多个参数跳转到另一个页面 query传参

前言:

上次写了params传参 这次query传参

1.点击toUserTaxDetails事件后 路由跳转且传参数

// 查询用户个税明细
   toUserTaxDetails(userId) {
     this.$router.push({
       path: '/monthTax/userTaxDetails',
       query: {
         taxSalaryUserId: userId,
         taxMonth: this.searchForm.taxMonth
       }
     })

2.在对应userTaxDetails路由页面的crated生命周期中接收相关参数

 created() {
    // 查询指定用户个税信息
    this.searchForm.taxSalaryUserId = this.$route.query.taxSalaryUserId || ''
    this.searchForm.taxMonth = this.$route.query.taxMonth || '' 
  },

3.路由相关

 //个税信息
  {
    path: '/monthTax',
    component: Layout,
    name: 'monthTax',
    redirect: '/monthTax/index',
    meta: {
      title: '个税信息',
      icon: 'monthtax',
    },
    children: [{
      path: 'index',
      component: () => import('@/views/monthtax/index'),
      name: 'monthTax',
      meta: {
        title: '员工个税明细',
      }
    },
     {
      path: 'userTaxDetails',
      component: () => import('@/views/monthtax/userTaxDetails'),
      name: 'userTaxDetails',
      meta: {
        title: '个税明细',
        hidden: true
      }      
    }, 
   ]
  },   
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值