From 141fd1da9ad745cfddf04b1460eb8453eac3d149 Mon Sep 17 00:00:00 2001 From: haoxr <1490493387@qq.com> Date: Sat, 21 Jan 2023 16:44:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: a9f1be702a7ea211dbda0204d99f38142bf8ba5d --- src/layout/components/Settings/index.vue | 56 +++++++++++++++++------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index d43e4da..8b55ec6 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -19,6 +19,21 @@ function changeLayout(layout: string) { window.document.body.setAttribute('layout', settingsStore.layout); } +// 主题颜色 +const themeColors = ref([ + '#409EFF', + '#304156', + '#11a983', + '#13c2c2', + '#6959CD', + '#f5222d' +]); + +function changeThemeColor(color: string) { + document.documentElement.style.setProperty('--el-color-primary', color); + settingsStore.changeSetting({ key: 'layout', value: color }); +} + onMounted(() => { window.document.body.setAttribute('layout', settingsStore.layout); }); @@ -27,7 +42,21 @@ onMounted(() => {