1
0
mirror of synced 2025-12-07 22:28:34 +08:00

优化下拉框

This commit is contained in:
xuliangzhan
2023-12-24 18:36:43 +08:00
parent a52adf33e6
commit 153b2b91da
12 changed files with 171 additions and 29 deletions

17
types/column.d.ts vendored
View File

@@ -181,11 +181,11 @@ export namespace VxeColumnPropTypes {
/**
* 只对 type=radio 有效,自定义单选框模板
*/
radio?: string | ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
radio?: string | ((params: VxeColumnSlotTypes.RadioSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
/**
* 只对 type=checkbox 有效,自定义复选框模板
*/
checkbox?: string | ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
checkbox?: string | ((params: VxeColumnSlotTypes.CheckboxSlotParams<D>) => SlotVNodeType[] | SlotVNodeType) | null
/**
* 自定义显示内容模板
*/
@@ -405,7 +405,7 @@ export namespace VxeColumnSlotTypes {
data: D[][]
}
export interface HeaderSlotParams<D = VxeTableDataRow> extends VxeTableDefines.CellRenderHeaderParams<D> { }
export interface HeaderSlotParams<D = VxeTableDataRow> extends VxeTableDefines.CellRenderHeaderParams<D> {}
export interface ContentSlotParams<D = VxeTableDataRow> {
column: VxeTableDefines.ColumnInfo<D>
@@ -421,6 +421,13 @@ export namespace VxeColumnSlotTypes {
export interface DefaultSlotParams<D = VxeTableDataRow> extends VxeTableDefines.CellRenderBodyParams<D> { }
export interface CheckboxSlotParams<D = VxeTableDataRow> extends DefaultSlotParams<D> {
checked: boolean
indeterminate: boolean
}
export interface RadioSlotParams<D = VxeTableDataRow> extends DefaultSlotParams<D> {
checked: boolean
}
export interface IconSlotParams<D = VxeTableDataRow> extends DefaultSlotParams<D> { }
}
@@ -444,11 +451,11 @@ export interface VxeColumnSlots<D = VxeTableDataRow> {
/**
* 只对 type=checkbox 有效,自定义复选框模板
*/
checkbox: (params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any
checkbox: (params: VxeColumnSlotTypes.CheckboxSlotParams<D>) => any
/**
* 只对 type=radio 有效,自定义单选框模板
*/
radio: (params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any
radio: (params: VxeColumnSlotTypes.RadioSlotParams<D>) => any
/**
* 只对 type=expand 有效,自定义展开后的内容模板
*/

5
types/grid.d.ts vendored
View File

@@ -593,6 +593,11 @@ export interface VxeGridSlots<D = VxeTableDataRow> {
$columnIndex: number
_columnIndex: number
checked?: boolean
indeterminate?: boolean
items: D[]
[key: string]: any
}) => any) | undefined
}

12
types/pulldown.d.ts vendored
View File

@@ -126,12 +126,24 @@ export interface VxePulldownListeners {
}
export interface VxePulldownSlots {
/**
* 自定义弹窗容器头部模板
*/
header: (params: {
[key: string]: any
}) => any
/**
* 自定义显示的内容
*/
default: (params: {
[key: string]: any
}) => any
/**
* 自定义弹窗容器底部模板
*/
footer: ((params: {
[key: string]: any
}) => any) | undefined
/**
* 自定义下拉面板显示的内容
*/

29
types/select.d.ts vendored
View File

@@ -232,10 +232,39 @@ export namespace VxeSelectEvents {
}
export interface VxeSelectSlots {
/**
* 自定义前缀图标模板
*/
prefix: (params: {
[key: string]: any
}) => any
/**
* 自定义弹窗容器头部模板
*/
header: (params: {
[key: string]: any
}) => any
/**
* 自定义弹窗容器选项模板
*/
option: ((params: {
option: any
group: any
[key: string]: any
}) => any) | undefined
/**
* 自定义弹窗容器底部模板
*/
footer: ((params: {
[key: string]: any
}) => any) | undefined
/**
* 自定义插槽模板
*/
[key: string]: ((params: {
option: any
group: any
[key: string]: any
}) => any) | undefined
}

3
types/table.d.ts vendored
View File

@@ -2892,6 +2892,9 @@ export namespace VxeTableDefines {
type: string
isHidden: boolean
hasFilter: boolean
checked?: boolean
indeterminate?: boolean
}
export interface CellRenderBodyParams<D = VxeTableDataRow> {