diff --git a/src/layouts/BasicLayout/index.vue b/src/layouts/BasicLayout/index.vue
index defe3e0..4fe32b2 100644
--- a/src/layouts/BasicLayout/index.vue
+++ b/src/layouts/BasicLayout/index.vue
@@ -11,7 +11,7 @@
-
+
@@ -23,7 +23,11 @@
-
+
+
+
+
+
@@ -47,7 +51,7 @@ import {
Notices,
UserCenter,
Search,
- Refresh,
+ Reload,
} from '../components';
const appStore = useAppStore();
diff --git a/src/layouts/components/header/Refresh.vue b/src/layouts/components/header/Reload.vue
similarity index 54%
rename from src/layouts/components/header/Refresh.vue
rename to src/layouts/components/header/Reload.vue
index 628036d..a915cbd 100644
--- a/src/layouts/components/header/Refresh.vue
+++ b/src/layouts/components/header/Reload.vue
@@ -1,7 +1,7 @@
-
+
刷新页面
@@ -9,8 +9,11 @@
diff --git a/src/layouts/components/index.ts b/src/layouts/components/index.ts
index 8474ad0..c9ae183 100644
--- a/src/layouts/components/index.ts
+++ b/src/layouts/components/index.ts
@@ -12,7 +12,7 @@ import Github from './header/Github.vue';
import Notices from './header/Notices.vue';
import UserCenter from './header/UserCenter.vue';
import Search from './header/Search.vue';
-import Refresh from './header/Refresh.vue';
+import Reload from './header/Reload.vue';
export {
Breadcrumb,
@@ -26,5 +26,5 @@ export {
Notices,
UserCenter,
Search,
- Refresh,
+ Reload,
};
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index 271c1fe..b8821b7 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -1,24 +1,27 @@
import { defineStore } from 'pinia';
+import { nextTick } from 'vue';
import { darkTheme, GlobalTheme } from 'naive-ui';
interface AppStatus {
+ title: string;
+ footerText: string;
collapsed: boolean;
fullScreen: boolean;
darkMode: boolean;
darkTheme: GlobalTheme | null;
- title: string;
- footerText: string;
+ loadFlag: boolean;
}
export const useAppStore = defineStore('app-store', {
state: (): AppStatus => {
return {
+ title: import.meta.env.VITE_APP_TITLE,
+ footerText: '哲学的基本问题是思维和存在的关系问题',
collapsed: false,
fullScreen: false,
darkMode: false,
darkTheme: null,
- title: import.meta.env.VITE_APP_TITLE,
- footerText: '哲学的基本问题是思维和存在的关系问题',
+ loadFlag: true,
};
},
actions: {
@@ -45,5 +48,21 @@ export const useAppStore = defineStore('app-store', {
this.darkTheme = null;
}
},
+ /**
+ * @description: 页面内容重载
+ * @param {number} delay - 延迟毫秒数
+ * @return {*}
+ */
+ async reloadPage(delay = 100) {
+ this.loadFlag = false;
+ await nextTick();
+ if (delay) {
+ setTimeout(() => {
+ this.loadFlag = true;
+ }, delay);
+ } else {
+ this.loadFlag = true;
+ }
+ },
},
});
diff --git a/src/views/test/test2.vue b/src/views/test/test2.vue
index 835de51..b58f4b0 100644
--- a/src/views/test/test2.vue
+++ b/src/views/test/test2.vue
@@ -1,6 +1,5 @@
- I prove that you have made the ju mp test2.
- {{ userStore.name }}
+ I prove that you have made the ju mp test2. {{ userStore.name }}