Эх сурвалжийг харах

feat: 切换主题弹窗中点击图片也能切换主题

zhouyuhao 11 сар өмнө
parent
commit
d631613ad2

+ 3 - 2
src/views/Layout/src/components/Header/HeaderView.vue

@@ -182,13 +182,13 @@ const handleLogin = () => {
           </div>
           <div class="picture-module">
             <div class="item" :class="{ active: themeStore.theme === 'light' }">
-              <img src="./images/light.png" alt="" />
+              <img @click="toggleThemeMode('light')" src="./images/light.png" alt="" />
               <div v-if="themeStore.theme === 'light'" class="selected-icon">
                 <span class="font_family icon-icon_confirm_b"></span>
               </div>
             </div>
             <div class="item" :class="{ active: themeStore.theme === 'dark' }">
-              <img src="./images/dark.png" alt="" />
+              <img @click="toggleThemeMode('dark')" src="./images/dark.png" alt="" />
               <div v-if="themeStore.theme === 'dark'" class="selected-icon">
                 <span class="font_family icon-icon_confirm_b"></span>
               </div>
@@ -363,6 +363,7 @@ div.el-popover.el-popper.toggle-theme-popover {
       img {
         width: 154px;
         height: 90px;
+        cursor: pointer;
       }
       &.active {
         border: 2px solid var(--color-theme);