浏览代码

颜色联动

YaolongHan 4 年之前
父节点
当前提交
df6eb9edb3
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/components/menuList.vue

+ 6 - 0
src/components/menuList.vue

@@ -287,6 +287,12 @@ export default {
       this.showStyle = !this.showStyle;
       //   改变颜色风格
       bus.$emit("changeStyleColor", this.showStyle);
+
+       /**
+       * 皮肤模式切换后,存储用户名,皮肤模式
+       */
+      const newV = this.showStyle ? 'dark':'light';
+      localStorage.setItem(`${this.userInfo.username}__skinMode`, newV)
     },
   },
 };