diff --git a/src/components/u-theme/index.vue b/src/components/u-theme/index.vue index cfb6c30..a6d4640 100644 --- a/src/components/u-theme/index.vue +++ b/src/components/u-theme/index.vue @@ -14,6 +14,18 @@ +
+ + + + + +
@@ -23,16 +35,12 @@
- - - - - + + +
+
+ +
@@ -42,6 +50,14 @@
+
+ + +
+
+ + +
@@ -57,7 +73,11 @@ const layout = ref(SettingStore.themeConfig.mode) const showTag = ref(SettingStore.themeConfig.showTag) const showLogo = ref(SettingStore.themeConfig.showLogo) + const uniqueOpened = ref(SettingStore.themeConfig.uniqueOpened) const primary = ref(SettingStore.themeConfig.primary) + const fixedHeader = ref(SettingStore.themeConfig.fixedHeader) + const gray = ref(SettingStore.themeConfig.gray) + const weak = ref(SettingStore.themeConfig.weak) const drawer = computed({ get() { @@ -105,6 +125,15 @@ changeSwitch('primary',val) } + // 修改灰色模式 + const changeGrayWeak = (type,val)=>{ + const body = document.documentElement as HTMLElement; + if (!val) return body.setAttribute("style", ""); + if (type === "gray") body.setAttribute("style", "filter: grayscale(1)"); + if (type === "weak") body.setAttribute("style", "filter: invert(80%)"); + changeSwitch(type,val) + } +