瀏覽代碼

提交刷新按钮

cl 1 年之前
父節點
當前提交
8e1e978b7a
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/views/header/Weather.vue

+ 3 - 2
src/views/header/Weather.vue

@@ -196,8 +196,9 @@ export default defineComponent({
 
       // 清除缓存
       const timestamp = new Date().getTime();
-      const url = window.location.href.replace(/(\?|&)t=\d+/, '');
-      window.location.href = `${url}${url.includes('?') ? '&' : '?'}t=${timestamp}`;
+      window.location.reload();
+      // const url = window.location.href.replace(/(\?|&)t=\d+/, '');
+      // window.location.href = `${url}${url.includes('?') ? '&' : '?'}t=${timestamp}`;
 
       // 刷新页面
       window.location.reload();