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

    技术2022-07-11  109

    原本路由 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)) } } },
    Processed: 0.010, SQL: 9