diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index d43e4dac..8b55ec6f 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(() => {