feat: vxe 暗黑模式

This commit is contained in:
xingyu4j
2022-11-23 18:05:36 +08:00
parent aae0b8c328
commit 0c6b448390
4 changed files with 89 additions and 2 deletions

View File

@ -1,8 +1,9 @@
import { App, unref } from 'vue'
import { App, unref, watch } from 'vue'
import XEUtils from 'xe-utils'
import './index.scss'
import './renderer'
import { i18n } from '@/plugins/vueI18n'
import { useAppStore } from '@/store/modules/app'
import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
import enUS from 'vxe-table/lib/locale/lang/en-US'
import {
@ -45,6 +46,18 @@ import {
Table
} from 'vxe-table'
const appStore = useAppStore()
watch(
() => appStore.getIsDark,
() => {
if (appStore.getIsDark) {
import('./theme/dark.scss')
} else {
import('./theme/light.scss')
}
},
{ immediate: true }
)
// 全局默认参数
VXETable.setup({
size: 'medium', // 全局尺寸