弹窗/或者点击按钮-路由跳转以后-再回来时要回显的问题

104 篇文章 0 订阅
  • 原本路由 http://localhost:9528/#/example/careerman

  • 点击跳转到新路由 http://localhost:9528/#/example/application?employeeId=11823&type=1
    在这里插入图片描述

  • 点击按钮 x 要让老页面的弹窗展示
    在这里插入图片描述

  • 思路是在返回老页面时路由里面传值, 在老页面mounted是监听路由的值,让弹窗显示

clickGoBack() {
      // 点击事件 路由跳转,并且带上 query 数据
        this.$router.push({ path: '/example/careerman', query: { employeeId: this.employeeId }})
    }

点击 x 以后的路由

  • http://localhost:9528/#/example/careerman?employeeId=11823
mounted() {
    // 在mounted 事件中 对路由里面的数据处理 打开弹窗或者其他处理
    if (this.$route.query.employeeId) {
      if (typeof (this.$route.query.employeeId) === 'number') {
        this.$refs.personalData.openDialog(Number(this.$route.query.employeeId))
      }
    }
  },
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值