js实现页面加载后再刷新一次

    handleRefresh() {
      const nowIndex = location.href.indexOf("&now=");
      location.href = location.href.slice(0, nowIndex) + "&now=" + Date.now();
      window.location.reload();
    },
    handleReloaded: function () {
      const { now } = this.$route.query;
      if (typeof now === "undefined" && location.href.includes("?")) {
        location.href = location.href + `&now=${Date.now()}`;
        window.location.reload();
      }
    },

posted @ 2022-05-26 09:03  徐同保  阅读(4)  评论(0编辑  收藏  举报  来源