From 35728817330e021d34f9205d1471d4722e220c00 Mon Sep 17 00:00:00 2001 From: xream Date: Wed, 10 Jan 2024 01:30:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=BB=98=E8=AE=A4=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E5=88=B7=E6=96=B0=E6=8C=89=E9=92=AE(?= =?UTF-8?q?=E5=8F=AF=E5=9C=A8=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=88=87=E6=8D=A2?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/NavBar.vue | 32 +++++++++++++++++++++++++++--- src/locales/en.ts | 1 + src/locales/zh.ts | 1 + src/store/global.ts | 9 +++++++++ src/types/store/globalStore.d.ts | 1 + src/views/Sub.vue | 4 ++-- src/views/Sync.vue | 2 +- src/views/settings/moreSetting.vue | 17 ++++++++++++++++ 9 files changed, 62 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6c9b30671..6c005b7d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.31", + "version": "2.14.32", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index c9adc1a7a..8264d7379 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -5,14 +5,16 @@ :tit-icon="currentTitleWhetherAsk" @on-click-icon="onClickNavbarIcon"> @@ -45,6 +47,7 @@ import { useRoute, useRouter } from 'vue-router'; import { useGlobalStore } from '@/store/global'; import { storeToRefs } from 'pinia'; import { Toast } from '@nutui/nutui'; +import { initStores } from "@/utils/initApp"; const { t, locale } = useI18n(); const router = useRouter(); @@ -52,7 +55,7 @@ const route = useRoute(); const globalStore = useGlobalStore(); const showLangSwitchPopup = ref(false); const langList = ['zh', 'en']; -const { isSimpleMode } = storeToRefs(globalStore); +const { isSimpleMode, showFloatingRefreshButton } = storeToRefs(globalStore); const isNeedBack = computed(() => { return route.meta.needNavBack ?? false; @@ -99,6 +102,15 @@ const setSimpleMode = (isSimpleMode: boolean) => { globalStore.setSimpleMode(isSimpleMode); }; +const refresh = () => { + if (['/subs', '/sync'].includes(route.path)) { + initStores(true, true, true); + } else { + window.location.reload(); + } + +}; +