vue-router清除url地址栏路由参数

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


 

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

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

  mounted() {

    // 获取当前路由的查询参数

    const query = { ...this.$route.query };

    // 删除指定的查询参数

    delete query.reportCoreId;

    // 使用 $router.replace() 方法更新路由

    this.$router.replace({ query });

  },

相关推荐

  1. vue参数router

    2024-04-26 19:04:03       53 阅读
  2. vue 怎么处理get请求,接收url地址参数

    2024-04-26 19:04:03       43 阅读
  3. vue-router

    2024-04-26 19:04:03       31 阅读
  4. vue-router(守卫)

    2024-04-26 19:04:03       39 阅读
  5. Vue router(守卫)

    2024-04-26 19:04:03       29 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-26 19:04:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-26 19:04:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-26 19:04:03       87 阅读
  4. Python语言-面向对象

    2024-04-26 19:04:03       96 阅读

热门阅读

  1. leetcode2418.按身高排序

    2024-04-26 19:04:03       34 阅读
  2. 虚拟机部署openeuler网络配置

    2024-04-26 19:04:03       36 阅读
  3. npm install CERT_HAS_EXPIRED解决方法

    2024-04-26 19:04:03       38 阅读
  4. BootLooder引导传参和镜像编译

    2024-04-26 19:04:03       30 阅读
  5. Git忽略文件

    2024-04-26 19:04:03       38 阅读
  6. ES6 新增功能复盘梳理

    2024-04-26 19:04:03       30 阅读
  7. python 学习笔记24 图片视频修复

    2024-04-26 19:04:03       31 阅读