1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-23 08:00:22 +08:00

feat(table): 添加vxe-table,适配naiveui主题,并替换掉之前table,自带导出

This commit is contained in:
leipu
2024-11-20 13:25:21 +08:00
parent 3c6dce3eeb
commit 85867263e6
11 changed files with 1013 additions and 41 deletions

View File

@@ -10,6 +10,7 @@ import { defaultLayout, defaultPrimaryColor, naiveThemeOverrides } from '@/setti
import { generate, getRgbStr } from '@arco-design/color'
import { useDark } from '@vueuse/core'
import { defineStore } from 'pinia'
import { VxeUI } from 'vxe-pc-ui'
export const useAppStore = defineStore('app', {
state: () => ({
@@ -40,6 +41,18 @@ export const useAppStore = defineStore('app', {
list: true,
dark: isDark,
})
VxeUI.setTheme(isDark ? 'dark' : 'light')
if (isDark) {
document.body.style.setProperty('--vxe-ui-font-color', '#fff')
}
else {
document.body.style.setProperty('--vxe-ui-font-color', '#000')
}
document.body.style.setProperty('--vxe-ui-font-primary-color', color)
document.body.style.setProperty('--vxe-ui-font-primary-lighten-color', color)
document.body.style.setProperty('--vxe-ui-font-primary-darken-color', color)
document.body.style.setProperty('--primary-color', getRgbStr(colors[5]))
this.naiveThemeOverrides.common = Object.assign(this.naiveThemeOverrides.common || {}, {
primaryColor: colors[5],