diff --git a/examples/sites/demos/apis/grid.js b/examples/sites/demos/apis/grid.js
index edbbadba08..f738e134c8 100644
--- a/examples/sites/demos/apis/grid.js
+++ b/examples/sites/demos/apis/grid.js
@@ -57,8 +57,8 @@ export default {
},
{
name: 'cell-class-name',
- typeAnchorName: 'IClassNameArgs',
- type: 'string | (args: IClassNameArgs) => string',
+ typeAnchorName: 'ICellClassNameArgs',
+ type: 'string | (args: ICellClassNameArgs) => string',
defaultValue: '',
desc: {
'zh-CN': '给单元格附加 className,也可以是函数',
@@ -2967,6 +2967,20 @@ export default {
mode: ['pc', 'mobile-first'],
pcDemo: 'grid-slot#slot-editor-slot'
},
+ {
+ name: 'expand-trigger',
+ defaultValue: '',
+ meta: {
+ stable: '3.25.0'
+ },
+ desc: {
+ 'zh-CN':
+ '自定义展开行图标,作用插槽参数说明:slots.expand-trigger({ $table, column, row },h),$table:表格组件对象,column:当前列配置,row:当前行数据,h:vue的渲染函数',
+ 'en-US': 'Customized expand row icon'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'grid-expand#expand-trigger-slot'
+ },
{
name: 'filter',
defaultValue: '',
@@ -3194,18 +3208,24 @@ interface IRow {
depTypes: ['IValidRules'],
code: `
interface IColumnConfig {
- type: 'index' | 'radio' | 'checkbox'
+ // 功能列的类型, 'index'行索引,'radio' 单选行, 'selection' 多选行
+ type: 'index' | 'radio' | 'selection'
+ // 列id
id: string
- prop: string
+ // 校验规则
rules: IValidRules
+ // 是否必填
required: boolean
property: string
title: string
- label: string
+ // 列宽度
width: string | number
+ // 自动分配宽度时的最小宽度
minWidth: string | number
+ // 是否可以调整列宽
resizable: boolean
- fixed: boolean
+ // 是否左、右冻结
+ fixed: 'left' | 'right'
align: 'left' | 'center' | 'right'
headerAlign: 'left' | 'center' | 'right'
footerAlign: 'left' | 'center' | 'right'
@@ -4153,6 +4173,30 @@ interface IFilterConfig {
sortable?: Sortable
}
`
+ },
+ {
+ name: 'ICellClassNameArgs',
+ type: 'type',
+ depTypes: ['IColumnConfig', 'IRow'],
+ code: `
+interface ICellClassNameArgs {
+ seq: number
+ // 当前行在树表中的层级
+ level: number
+ // 当前行数据
+ row: IRow
+ // 表格数据
+ data: IRow[]
+ // 表格行索引
+ rowIndex: number
+ $rowIndex: number
+ // 表格列配置
+ column: IColumnConfig
+ // 所有列中(包含隐藏列)索引
+ columnIndex: number
+ // 已渲染列中的索引
+ $columnIndex: number
+}`
}
]
}
diff --git a/examples/sites/demos/pc/app/grid/expand/expand-config.spec.js b/examples/sites/demos/pc/app/grid/expand/expand-config.spec.ts
similarity index 100%
rename from examples/sites/demos/pc/app/grid/expand/expand-config.spec.js
rename to examples/sites/demos/pc/app/grid/expand/expand-config.spec.ts
diff --git a/examples/sites/demos/pc/app/grid/expand/expand-trigger-slot-composition-api.vue b/examples/sites/demos/pc/app/grid/expand/expand-trigger-slot-composition-api.vue
new file mode 100644
index 0000000000..58f5d854d2
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/expand/expand-trigger-slot-composition-api.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
通过 expand-trigger
插槽可以自定义展开行图标。
You can customize the expand row icon through the expand-trigger
slot.