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();
      }
    },

猜你喜欢

转载自blog.csdn.net/xutongbao/article/details/124978134
今日推荐