Эх сурвалжийг харах

缓存测试,header加载

Michael Wang 4 жил өмнө
parent
commit
760647a253

+ 1 - 1
src/features/mark/MarkHeader.vue

@@ -1,7 +1,7 @@
 <template>
   <div
     class="tw-flex tw-gap-2 tw-justify-between tw-items-center header-container tw-px-1"
-    v-if="store.setting"
+    v-if="store.setting && store.setting.subject.name"
   >
     <div style="max-width: 10%">
       <a

+ 1 - 0
src/features/mark/MarkHistory.vue

@@ -75,6 +75,7 @@ export default defineComponent({
         replaceCurrentTask(store.historyTasks[0]);
       } else {
         replaceCurrentTask(store.tasks[0]);
+        store.historyTasks.splice(0);
       }
     });
 

+ 2 - 0
src/utils/utils.ts

@@ -1,6 +1,8 @@
 import { store } from "@/features/mark/store";
 import { PictureSlice } from "@/types";
 
+// 通过回看的测试,打开回看,再关闭回看,稍等一会儿再打开回看,确实可以看到该缓存时缓存了,该丢弃时丢弃了
+
 // 把store.currentTask当做 weakRef ,当它不存在时,就丢弃它所有的图片
 const weakedMapImages = new WeakMap<Object, Map<string, HTMLImageElement>>();