vue 使用路由重复跳转同一页面

重复跳转的时候发送新的date

this.$router.push(`/messages?date=${Date.now()}`).catch(() => {});

页面内监听路由变化

...

  watch: {
    $route(to, from) {
      if (to.query.date) {
        this.getList();
      }
    },
  },

...
posted @ 2021-12-03 11:44  Ajanuw  阅读(1065)  评论(0编辑  收藏  举报