admin 管理员组

文章数量: 1184232

从一个页面通过下图的点击事件拿到一个id之后跳转到另一个页面

在另一个页面得到这个id

this.reportId = this.$route.query.reportCoreId;


在另一个页面得到这个id之后,刷新浏览器页面还是会存在在url地址栏中

然后再这样就可以 清除地址栏路由参数

    // 获取当前路由的查询参数
    const query = { ...this.$route.query };
    // 检查要删除的查询参数是否存在,如果存在则删除
    if (query.reportCoreId) {
      delete query.reportCoreId;
      // 使用 $router.replace() 方法更新路由,但不改变浏览历史
      this.$router.replace({ query });
    }

本文标签: 在另一个 页面得到 编程