From f9677d9a4a588a953d4ffa04a369b6ec8cbb07db Mon Sep 17 00:00:00 2001
From: pany <939630029@qq.com>
Date: Thu, 6 Jul 2023 14:10:14 +0800
Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8F=90=E7=A4=BA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E6=9C=89=E7=A0=B4=E5=9D=8F=E6=80=A7=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 17 +++++++++++++++++
src/layouts/components/Settings/index.vue | 10 ++--------
src/utils/index.ts | 7 +++++++
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index b1b5840..b267d5b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,7 @@
diff --git a/src/layouts/components/Settings/index.vue b/src/layouts/components/Settings/index.vue
index b8e16eb..6b89e2a 100644
--- a/src/layouts/components/Settings/index.vue
+++ b/src/layouts/components/Settings/index.vue
@@ -2,7 +2,7 @@
import { watchEffect } from "vue"
import { storeToRefs } from "pinia"
import { useSettingsStore } from "@/store/modules/settings"
-import { removeConfigLayout } from "@/utils/cache/local-storage"
+import { resetConfigLayout } from "@/utils"
import { Refresh } from "@element-plus/icons-vue"
const settingsStore = useSettingsStore()
@@ -38,12 +38,6 @@ const switchSettings = {
watchEffect(() => {
layoutMode.value !== "left" && (fixedHeader.value = true)
})
-
-/** 重置配置 */
-const reset = () => {
- removeConfigLayout()
- location.reload()
-}
@@ -59,7 +53,7 @@ const reset = () => {
{{ settingName }}
- 重 置
+ 重 置
diff --git a/src/utils/index.ts b/src/utils/index.ts
index d3c8565..290c7e4 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,4 +1,5 @@
import dayjs from "dayjs"
+import { removeConfigLayout } from "@/utils/cache/local-storage"
/** 格式化时间 */
export const formatDateTime = (time: string | number | Date) => {
@@ -25,3 +26,9 @@ export const setCssVariableValue = (cssVariableName: string, cssVariableValue: s
console.error(error)
}
}
+
+/** 重置项目配置 */
+export const resetConfigLayout = () => {
+ removeConfigLayout()
+ location.reload()
+}