Skip to content

Commit

Permalink
feat: 🚀 预定义主题颜色
Browse files Browse the repository at this point in the history
  • Loading branch information
Halsey committed Jul 7, 2022
1 parent aec7fdc commit 8219178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"fastmock",
"Geeker",
"Gitee",
"hexs",
"iconfont",
"Jheng",
"juejin",
Expand Down
5 changes: 3 additions & 2 deletions src/layout/Header/components/Theme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<el-divider class="divider" content-position="center">全局主题</el-divider>
<div class="theme-item">
<span>primary</span>
<el-color-picker v-model="themeConfig.primary" @change="changePrimary"> </el-color-picker>
<el-color-picker v-model="themeConfig.primary" :predefine="colorList" @change="changePrimary"> </el-color-picker>
</div>
<div class="theme-item">
<span>暗黑模式</span>
Expand All @@ -30,7 +30,8 @@ import { ref, computed } from "vue";
import { useTheme } from "@/hooks/useTheme";
import SwitchDark from "@/components/SwitchDark/index.vue";
import { GlobalStore } from "@/store";
// 预定义主题颜色
const colorList = ["#409EFF", "#DAA96E", "#0C819F", "#009688", "#27ae60", "#ff5c93", "#e74c3c", "#fd726d", "#f39c12", "#9b59b6"];
// 主题初始化
const globalStore = GlobalStore();
const themeConfig = computed(() => globalStore.themeConfig);
Expand Down

1 comment on commit 8219178

@vercel
Copy link

@vercel vercel bot commented on 8219178 Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.