当前位置: 首页>前端>正文

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




https://www.xamrdz.com/web/24e1937539.html

相关文章: