From a79d67f8a9a9fa02f9d25f987b9611af965c484f Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 22 十月 2026 18:41:01 +0800
Subject: [PATCH] 修改了风格
---
src/layout/index.vue | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 214d86f..c56206e 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -1,5 +1,5 @@
<template>
- <div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}">
+ <div :class="classObj" class="app-wrapper">
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar class="sidebar-container"/>
<div :class="{hasTagsView:needTagsView}" class="main-container">
@@ -21,6 +21,7 @@
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
import variables from '@/assets/styles/variables.scss'
+import { applyTheme, setStoredTheme } from '@/utils/theme'
export default {
name: 'Layout',
@@ -54,7 +55,20 @@
return variables;
}
},
+ created() {
+ // 杩涘叆 Layout 鏃跺簲鐢ㄥ綋鍓嶄富棰樿壊锛堝苟璁颁綇閫夋嫨锛�
+ this.applyCurrentTheme()
+ },
+ watch: {
+ theme(val) {
+ this.applyCurrentTheme()
+ setStoredTheme(val)
+ }
+ },
methods: {
+ applyCurrentTheme() {
+ applyTheme(this.theme)
+ },
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
}
--
Gitblit v1.9.3