Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default {
fixedRows: {
type: Array as PropType<TdBaseTableProps['fixedRows']>,
},
/** 表尾总结行 */
footerSummary: {
type: [String, Function] as PropType<TdBaseTableProps['footerSummary']>,
},
/** 表格高度,超出后会出现滚动条。示例:100, '30%', '300'。值为数字类型,会自动加上单位 px。如果不是绝对固定表格高度,建议使用 `maxHeight` */
height: {
type: [String, Number] as PropType<TdBaseTableProps['height']>,
Expand Down Expand Up @@ -104,4 +108,6 @@ export default {
onRowClick: Function as PropType<TdBaseTableProps['onRowClick']>,
/** 表格内容滚动时触发 */
onScroll: Function as PropType<TdBaseTableProps['onScroll']>,
/** 表格内容滚动到底部时触发,可用于实现滚动加载 */
onScrollToBottom: Function as PropType<TdBaseTableProps['onScrollToBottom']>,
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ columns | Array | [] | table column configs。Typescript: `Array<BaseTableCol<T>
data | Array | [] | table data。Typescript: `Array<T>` | N
empty | String / Slot / Function | '' | empty text or empty element。Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
fixedRows | Array | - | `1.9.3`。Typescript: `Array<number>` | N
footerSummary | String / Slot / Function | - | footer summary content。Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
height | String / Number | - | table height | N
loading | Boolean / Slot / Function | undefined | loading state table。Typescript: `boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
loadingProps | Object | - | Typescript: `Partial<LoadingProps>`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts) | N
Expand All @@ -28,6 +29,7 @@ verticalAlign | String | middle | vertical align。options: top/middle/bottom |
onCellClick | Function | | Typescript: `(context: BaseTableCellEventContext<T>) => void`<br/>trigger on cell clicked。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface BaseTableCellEventContext<T> { row: T; col: BaseTableCol; rowIndex: number; colIndex: number; e: MouseEvent }`<br/> | N
onRowClick | Function | | Typescript: `(context: RowEventContext<T>) => void`<br/>trigger on row click。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface RowEventContext<T> { row: T; index: number; e: MouseEvent }`<br/> | N
onScroll | Function | | Typescript: `(params: { e: Event }) => void`<br/>trigger on table content scroll | N
onScrollToBottom | Function | | Typescript: `() => void`<br/>Typescript: `Partial<AffixProps>` | N

### BaseTable Events

Expand All @@ -36,6 +38,7 @@ name | params | description
cell-click | `(context: BaseTableCellEventContext<T>)` | trigger on cell clicked。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface BaseTableCellEventContext<T> { row: T; col: BaseTableCol; rowIndex: number; colIndex: number; e: MouseEvent }`<br/>
row-click | `(context: RowEventContext<T>)` | trigger on row click。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface RowEventContext<T> { row: T; index: number; e: MouseEvent }`<br/>
scroll | `(params: { e: Event })` | trigger on table content scroll
scroll-to-bottom | \- | Typescript: `Partial<AffixProps>`

### BaseTableInstanceFunctions 组件实例方法

Expand Down
3 changes: 3 additions & 0 deletions packages/products/tdesign-mobile-vue/src/table/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ columns | Array | [] | 列配置,泛型 T 指表格数据类型。TS 类型:
data | Array | [] | 数据源,泛型 T 指表格数据类型。TS 类型:`Array<T>` | N
empty | String / Slot / Function | '' | 空表格呈现样式,支持全局配置 `GlobalConfigProvider`。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
fixedRows | Array | - | `1.9.3`。固定行(冻结行),示例:[M, N],表示冻结表头 M 行和表尾 N 行。M 和 N 值为 0 时,表示不冻结行。TS 类型:`Array<number>` | N
footerSummary | String / Slot / Function | - | 表尾总结行。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
height | String / Number | - | 表格高度,超出后会出现滚动条。示例:100, '30%', '300'。值为数字类型,会自动加上单位 px。如果不是绝对固定表格高度,建议使用 `maxHeight` | N
loading | Boolean / Slot / Function | undefined | 加载中状态。值为 `true` 会显示默认加载中样式,可以通过 Function 和 插槽 自定义加载状态呈现内容和样式。值为 `false` 则会取消加载状态。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
loadingProps | Object | - | 透传加载组件全部属性。TS 类型:`Partial<LoadingProps>`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts) | N
Expand All @@ -28,6 +29,7 @@ verticalAlign | String | middle | 行内容上下方向对齐。可选项:top/
onCellClick | Function | | TS 类型:`(context: BaseTableCellEventContext<T>) => void`<br/>单元格点击时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface BaseTableCellEventContext<T> { row: T; col: BaseTableCol; rowIndex: number; colIndex: number; e: MouseEvent }`<br/> | N
onRowClick | Function | | TS 类型:`(context: RowEventContext<T>) => void`<br/>行点击时触发,泛型 T 指表格数据类型。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface RowEventContext<T> { row: T; index: number; e: MouseEvent }`<br/> | N
onScroll | Function | | TS 类型:`(params: { e: Event }) => void`<br/>表格内容滚动时触发 | N
onScrollToBottom | Function | | TS 类型:`() => void`<br/>表格内容滚动到底部时触发,可用于实现滚动加载。TS 类型:`Partial<AffixProps>` | N

### BaseTable Events

Expand All @@ -36,6 +38,7 @@ onScroll | Function | | TS 类型:`(params: { e: Event }) => void`<br/>表格
cell-click | `(context: BaseTableCellEventContext<T>)` | 单元格点击时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface BaseTableCellEventContext<T> { row: T; col: BaseTableCol; rowIndex: number; colIndex: number; e: MouseEvent }`<br/>
row-click | `(context: RowEventContext<T>)` | 行点击时触发,泛型 T 指表格数据类型。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/table/type.ts)。<br/>`interface RowEventContext<T> { row: T; index: number; e: MouseEvent }`<br/>
scroll | `(params: { e: Event })` | 表格内容滚动时触发
scroll-to-bottom | \- | 表格内容滚动到底部时触发,可用于实现滚动加载。TS 类型:`Partial<AffixProps>`

### BaseTableInstanceFunctions 组件实例方法

Expand Down
8 changes: 8 additions & 0 deletions packages/products/tdesign-mobile-vue/src/table/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export interface TdBaseTableProps<T extends TableRowData = TableRowData> {
* 固定行(冻结行),示例:[M, N],表示冻结表头 M 行和表尾 N 行。M 和 N 值为 0 时,表示不冻结行
*/
fixedRows?: Array<number>;
/**
* 表尾总结行
*/
footerSummary?: string | TNode;
/**
* 表格高度,超出后会出现滚动条。示例:100, '30%', '300'。值为数字类型,会自动加上单位 px。如果不是绝对固定表格高度,建议使用 `maxHeight`
*/
Expand Down Expand Up @@ -106,6 +110,10 @@ export interface TdBaseTableProps<T extends TableRowData = TableRowData> {
* 表格内容滚动时触发
*/
onScroll?: (params: { e: Event }) => void;
/**
* 表格内容滚动到底部时触发,可用于实现滚动加载
*/
onScrollToBottom?: () => void;
}

/** 组件实例方法 */
Expand Down
45 changes: 42 additions & 3 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -10779,7 +10779,8 @@
"id": 2878,
"platform_framework": [
"1",
"2"
"2",
"8"
],
"component": "BaseTable",
"field_category": 1,
Expand Down Expand Up @@ -10809,7 +10810,8 @@
"field_category_text": "Props",
"platform_framework_text": [
"Vue(PC)",
"React(PC)"
"React(PC)",
"Vue(Mobile)"
],
"field_type_text": [
"String",
Expand Down Expand Up @@ -12664,6 +12666,43 @@
],
"field_type_text": []
},
{
"id": 1773210471,
"platform_framework": [
"8"
],
"component": "BaseTable",
"field_category": 2,
"field_name": "scrollToBottom",
"field_type": [
"2"
],
"field_default_value": "50",
"field_enum": "",
"field_desc_zh": "表格内容滚动到底部时触发,可用于实现滚动加载",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2026-03-11 06:27:51",
"update_time": "2026-03-11 06:27:51",
"event_output": null,
"custom_field_type": "Partial<AffixProps>",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Events",
"platform_framework_text": [
"Vue(Mobile)"
],
"field_type_text": [
"Number"
]
},
{
"id": 591,
"platform_framework": [
Expand Down Expand Up @@ -151026,7 +151065,7 @@
"create_time": "2026-03-20 08:31:35",
"update_time": "2026-03-20 08:31:35",
"event_output": null,
"custom_field_type": "",
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
Expand Down