1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-12-26 19:20:21 +08:00

feat: 增加设置主题色功能

This commit is contained in:
zclzone
2024-05-10 20:02:55 +08:00
parent 621c34a1fb
commit cf3c4b9020
15 changed files with 3259 additions and 2714 deletions

View File

@@ -0,0 +1,25 @@
<template>
<n-tooltip trigger="hover">
<template #trigger>
<n-color-picker
class="mr-16 h-40 w-80"
:value="appStore.primaryColor"
:swatches="primaryColors"
:on-update:value="(v) => appStore.setPrimaryColor(v)"
/>
</template>
设置主题色
</n-tooltip>
</template>
<script setup>
import { getPresetColors } from '@arco-design/color'
import { useAppStore } from '@/store'
const appStore = useAppStore()
const primaryColors = Object.entries(getPresetColors()).map(([, value]) => value.primary)
watchEffect(() => {
appStore.setThemeColor(appStore.primaryColor, appStore.isDark)
})
</script>