فهرست منبع

fix: 修复env更新title后,store不更新

xzz2021 2 ماه پیش
والد
کامیت
319cdd1820
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/store/modules/app.ts

+ 2 - 0
src/store/modules/app.ts

@@ -328,6 +328,8 @@ export const useAppStore = defineStore('app', {
         valueLight: 'light'
       })
       isDark.value = this.getIsDark
+      const newTitle = import.meta.env.VITE_APP_TITLE
+      newTitle !== this.getTitle && this.setTitle(newTitle)
     }
   },
   persist: true