File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
packages/effects/plugins/src/vxe-table Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { VxeGridSlots , VxeGridSlotTypes } from 'vxe-table' ;
2
+
3
+ import type { SlotsType } from 'vue' ;
4
+
1
5
import type { BaseFormComponentType } from '@vben-core/form-ui' ;
2
6
3
7
import type { ExtendedVxeGridApi , VxeGridProps } from './types' ;
@@ -9,6 +13,12 @@ import { useStore } from '@vben-core/shared/store';
9
13
import { VxeGridApi } from './api' ;
10
14
import VxeGrid from './use-vxe-grid.vue' ;
11
15
16
+ type FilteredSlots < T > = {
17
+ [ K in keyof VxeGridSlots < T > as K extends 'form'
18
+ ? never
19
+ : K ] : VxeGridSlots < T > [ K ] ;
20
+ } ;
21
+
12
22
export function useVbenVxeGrid <
13
23
T extends Record < string , any > = any ,
14
24
D extends BaseFormComponentType = BaseFormComponentType ,
@@ -31,6 +41,16 @@ export function useVbenVxeGrid<
31
41
{
32
42
name : 'VbenVxeGrid' ,
33
43
inheritAttrs : false ,
44
+ slots : Object as SlotsType <
45
+ {
46
+ // 表格标题
47
+ 'table-title' : undefined ;
48
+ // 工具栏左侧部分
49
+ 'toolbar-actions' : VxeGridSlotTypes . DefaultSlotParams < T > ;
50
+ // 工具栏右侧部分
51
+ 'toolbar-tools' : VxeGridSlotTypes . DefaultSlotParams < T > ;
52
+ } & FilteredSlots < T >
53
+ > ,
34
54
} ,
35
55
) ;
36
56
// Add reactivity support
You can’t perform that action at this time.
0 commit comments