|
@@ -1,8 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import navDark from '@/assets/svg/nav-theme-dark.svg'
|
|
|
|
|
-import navLight from '@/assets/svg/nav-theme-light.svg'
|
|
|
|
|
-import headerDark from '@/assets/svg/header-theme-dark.svg'
|
|
|
|
|
import { useThemeStore } from '@/stores/theme'
|
|
import { useThemeStore } from '@/stores/theme'
|
|
|
|
|
+import { themeStyleList } from '@/utils/constants'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
modelValue: Boolean
|
|
modelValue: Boolean
|
|
@@ -44,26 +42,6 @@ const themeColors = [
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
const themeStyle = computed(() => themeStore.themeStyle)
|
|
const themeStyle = computed(() => themeStore.themeStyle)
|
|
|
-const styleList = [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'nav-dark',
|
|
|
|
|
- img: navDark,
|
|
|
|
|
- bgColor: '#001529',
|
|
|
|
|
- textColor: '#BBB'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'nav-light',
|
|
|
|
|
- img: navLight,
|
|
|
|
|
- bgColor: '#fff',
|
|
|
|
|
- textColor: '#303133'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'header-dark',
|
|
|
|
|
- img: headerDark,
|
|
|
|
|
- bgColor: '#001529',
|
|
|
|
|
- textColor: '#BBB'
|
|
|
|
|
- }
|
|
|
|
|
-]
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -82,7 +60,12 @@ const styleList = [
|
|
|
</el-space>
|
|
</el-space>
|
|
|
<el-divider>整体风格</el-divider>
|
|
<el-divider>整体风格</el-divider>
|
|
|
<el-space wrap :size="20">
|
|
<el-space wrap :size="20">
|
|
|
- <div class="relative" v-for="(item, index) in styleList" :key="index" @click="themeStore.setThemeStyle(item)">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="relative"
|
|
|
|
|
+ v-for="(item, index) in themeStyleList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ @click="themeStore.setThemeStyle(item.name)"
|
|
|
|
|
+ >
|
|
|
<img :src="item.img" alt="" />
|
|
<img :src="item.img" alt="" />
|
|
|
<div class="absolute right-10px bottom-10px" v-if="item.name === themeStyle.name">
|
|
<div class="absolute right-10px bottom-10px" v-if="item.name === themeStyle.name">
|
|
|
<el-icon :color="themeColor" size="18"><Check /></el-icon>
|
|
<el-icon :color="themeColor" size="18"><Check /></el-icon>
|