# 01. 主题配置
URL: /%E6%96%87%E6%A1%A3/04.%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/01.%20%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91/06.%20%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE/01.%20%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE


# 01. 主题配置

## 默认主题配置

默认全局主题色配置位于 [build/config/glob/themeConfig.ts](https://github.com/jeecgboot/jeecgboot-vue3/tree/master/build/config/themeConfig.ts) 内

只需要修改 primaryColor 为您需要的配色，然后重新执行 `yarn serve` 即可

## 颜色配置

用于预设一些颜色数组

在 [src/settings/designSetting.ts](https://github.com/jeecgboot/jeecgboot-vue3/tree/master/src/settings/designSetting.ts) 内配置

```js
//  app主题色预设
export const APP_PRESET_COLOR_LIST: string[] = [
  '#0960bd',
  '#0084f4',
  '#009688',
  '#536dfe',
  '#ff5c93',
  '#ee4f12',
  '#0096c7',
  '#9c27b0',
  '#ff9800',
];

// 顶部背景色预设
export const HEADER_PRESET_BG_COLOR_LIST: string[] = [
  '#ffffff',
  '#009688',
  '#5172DC',
  '#1E9FFF',
  '#018ffb',
  '#409eff',
  '#4e73df',
  '#e74c3c',
  '#24292e',
  '#394664',
  '#001529',
  '#383f45',
];

// 左侧菜单背景色预设
export const SIDE_BAR_BG_COLOR_LIST: string[] = [
  '#001529',
  '#273352',
  '#ffffff',
  '#191b24',
  '#191a23',
  '#304156',
  '#001628',
  '#28333E',
  '#344058',
  '#383f45',
];
```

## 项目配置

在 [src/settings/projectSetting.ts](https://github.com/jeecgboot/jeecgboot-vue3/tree/master/src/settings/projectSetting.ts) 内配置

```js
// 项目主题色
themeColor: primaryColor,
...
// 头部配置
headerSetting: {
    // 背景色
    bgColor: HEADER_PRESET_BG_COLOR_LIST[0],
    // 主题
    theme: ThemeEnum.LIGHT,
    ...
}

// 菜单配置
menuSetting: {
  // 背景色
  bgColor: SIDE_BAR_BG_COLOR_LIST[0],
  ...
}
```
