xto-fronted 0.4.19 → 0.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,6 +97,7 @@ const openSettingsDrawer = () => {
97
97
  // 切换布局模式
98
98
  const handleLayoutChange = (mode: LayoutMode) => {
99
99
  appStore.setLayout(mode)
100
+ drawerVisible.value = false
100
101
  }
101
102
 
102
103
  // 切换灰色模式
@@ -110,6 +111,18 @@ const handleGreyModeChange = (value: boolean) => {
110
111
  }
111
112
  }
112
113
 
114
+ // 抽屉内灰色模式开关
115
+ const handleGreyModeToggle = () => {
116
+ handleGreyModeChange(!greyMode.value)
117
+ drawerVisible.value = false
118
+ }
119
+
120
+ // 抽屉内暗黑模式开关
121
+ const handleDarkModeToggle = () => {
122
+ appStore.toggleTheme()
123
+ drawerVisible.value = false
124
+ }
125
+
113
126
  // 切换全屏
114
127
  const toggleFullscreen = () => {
115
128
  if (!document.fullscreenElement) {
@@ -154,6 +167,7 @@ const handleSearchItemClick = (path: string) => {
154
167
  // 设置主题色
155
168
  const handleColorChange = (color: string) => {
156
169
  appStore.setPrimaryColor(color)
170
+ drawerVisible.value = false
157
171
  }
158
172
 
159
173
  // 个人信息
@@ -406,13 +420,13 @@ onUnmounted(() => {
406
420
  <div class="settings-switch-list">
407
421
  <div class="settings-switch-item">
408
422
  <span>灰色模式</span>
409
- <div class="switch-wrapper" :class="{ 'is-checked': greyMode }" @click="handleGreyModeChange(!greyMode)">
423
+ <div class="switch-wrapper" :class="{ 'is-checked': greyMode }" @click="handleGreyModeToggle">
410
424
  <span class="switch-core"></span>
411
425
  </div>
412
426
  </div>
413
427
  <div class="settings-switch-item">
414
428
  <span>暗黑模式</span>
415
- <div class="switch-wrapper" :class="{ 'is-checked': appStore.isDark }" @click="toggleTheme">
429
+ <div class="switch-wrapper" :class="{ 'is-checked': appStore.isDark }" @click="handleDarkModeToggle">
416
430
  <span class="switch-core"></span>
417
431
  </div>
418
432
  </div>