diff --git a/src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue b/src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue
index e0e5549c..2fd83c69 100644
--- a/src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue
+++ b/src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue
@@ -8,23 +8,29 @@ const route = useRoute()
const settingsStore = useSettingsStore()
-const breadcrumbList = computed(() => {
- const breadcrumbList = []
+const breadcrumbList = ref<{ path: string, title: string }[]>([])
+watch(() => route.matched, () => {
+ if (route.name === 'reload') {
+ return
+ }
+ const list = []
if (settingsStore.settings.home.enable) {
- breadcrumbList.push({
+ list.push({
path: settingsStore.settings.home.fullPath,
title: settingsStore.settings.home.title,
})
}
route.matched.forEach((item) => {
if (item.meta?.breadcrumb !== false) {
- breadcrumbList.push({
+ list.push({
path: item.path,
title: item.meta?.title,
})
}
})
- return breadcrumbList
+ breadcrumbList.value = list
+}, {
+ immediate: true,
})
function pathCompile(path: string) {
diff --git a/src/layouts/index.vue b/src/layouts/index.vue
index 91b1ff13..092958b6 100755
--- a/src/layouts/index.vue
+++ b/src/layouts/index.vue
@@ -132,7 +132,7 @@ const enableAppSetting = import.meta.env.VITE_APP_SETTING
-
+
diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts
index e8c4de93..a157a93d 100755
--- a/src/store/modules/settings.ts
+++ b/src/store/modules/settings.ts
@@ -87,6 +87,13 @@ const useSettingsStore = defineStore(
break
}
+ // 页面是否刷新
+ const isReloading = ref(false)
+ // 切换当前页面是否刷新
+ function setIsReloading(value?: boolean) {
+ isReloading.value = value ?? !isReloading.value
+ }
+
// 页面标题
const title = ref()
// 记录页面标题
@@ -152,6 +159,8 @@ const useSettingsStore = defineStore(
settings,
currentColorScheme,
os,
+ isReloading,
+ setIsReloading,
title,
setTitle,
mode,
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index 45ac3ab8..d5b1dfc1 100755
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -11,11 +11,11 @@ declare namespace Settings {
interface app {
/**
* 颜色方案
- * @默认值 `''` 跟随系统
- * @可选值 `'light'` 明亮模式
+ * @默认值 `'light'` 明亮模式
* @可选值 `'dark'` 暗黑模式
+ * @可选值 `''` 跟随系统
*/
- colorScheme?: '' | 'light' | 'dark'
+ colorScheme?: 'light' | 'dark' | ''
/**
* 圆角系数
* @默认值 `0.5`
diff --git a/src/utils/composables/useMainPage.ts b/src/utils/composables/useMainPage.ts
index 5d6600ce..6f35e452 100755
--- a/src/utils/composables/useMainPage.ts
+++ b/src/utils/composables/useMainPage.ts
@@ -1,9 +1,18 @@
+import useSettingsStore from '@/store/modules/settings'
+
export default function useMainPage() {
const router = useRouter()
+ const settingsStore = useSettingsStore()
+
function reload() {
+ settingsStore.setIsReloading(true)
router.push({
name: 'reload',
+ }).then(() => {
+ setTimeout(() => {
+ settingsStore.setIsReloading(false)
+ }, 100)
})
}