From ecfe66a0199606241c73a52519bbe800c9aa31f8 Mon Sep 17 00:00:00 2001 From: 雪忆 <1455668754@qq.com> Date: 星期一, 29 七月 2024 15:10:40 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- src/components/VxeTable/src/VxeBasicTable.tsx | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/VxeTable/src/VxeBasicTable.tsx b/src/components/VxeTable/src/VxeBasicTable.tsx index e48cb10..d51885d 100644 --- a/src/components/VxeTable/src/VxeBasicTable.tsx +++ b/src/components/VxeTable/src/VxeBasicTable.tsx @@ -1,22 +1,25 @@ -import { defineComponent, computed, ref } from 'vue'; +import { defineComponent, computed, ref, watch } from 'vue'; import { BasicTableProps } from './types'; import { basicProps } from './props'; import { ignorePropKeys } from './const'; import { basicEmits } from './emits'; import XEUtils from 'xe-utils'; -import type { +import { VxeGridInstance, VxeGridEventProps, GridMethods, TableMethods, TableEditMethods, TableValidatorMethods, + VxeUI, + VxeGlobalThemeName, + VxeGrid, } from 'vxe-table'; -import { Grid as VxeGrid } from 'vxe-table'; import { extendSlots } from '@/utils/helper/tsxHelper'; import { gridComponentMethodKeys } from './methods'; import { omit } from 'lodash-es'; +import { useRootSetting } from '@/hooks/setting/useRootSetting'; export default defineComponent({ name: 'VxeBasicTable', @@ -25,7 +28,14 @@ setup(props, { emit, attrs }) { const tableElRef = ref<VxeGridInstance>(); const emitEvents: VxeGridEventProps = {}; - + const { getDarkMode } = useRootSetting(); + watch( + () => getDarkMode.value, + () => { + VxeUI.setTheme(getDarkMode.value as VxeGlobalThemeName); + }, + { immediate: true }, + ); const extendTableMethods = (methodKeys) => { const funcs: any = {}; methodKeys.forEach((name) => { -- Gitblit v1.8.0