chenlei пре 10 месеци
родитељ
комит
9ff96c8bbc
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 1 0
      components.d.ts
  2. 2 1
      src/index/views/home/components/menu/index.ylct.vue

+ 1 - 0
components.d.ts

@@ -9,6 +9,7 @@ declare module 'vue' {
   export interface GlobalComponents {
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElImage: typeof import('element-plus/es')['ElImage']
+    ElPopover: typeof import('element-plus/es')['ElPopover']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']

+ 2 - 1
src/index/views/home/components/menu/index.ylct.vue

@@ -118,7 +118,7 @@
   let helperVisible = false;
   const starSum = ref(0);
   const shareVisible = ref(false);
-  const visitCount = localStorage.getItem('visitCount') ?? 0;
+  const visitCount = ref(0);
 
   const closeHelper = () => {
     window.$('#interaction-modal').removeClass('fadeIn');
@@ -144,6 +144,7 @@
 
     if (!data) return;
     starSum.value = data.starSum;
+    visitCount.value = data.visitSum || Number(localStorage.getItem('visitCount') ?? 0);
   };
 
   onMounted(() => {