Skip to content

Commit 9886eb8

Browse files
jevin98sleeprite
authored andcommitted
!494 feat(table): 新增column.exportCellType
* feat(table): 新增column.exportCellType
1 parent e6f916e commit 9886eb8

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

docs/src/document/zh-CN/components/table.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ const defaultToolbars = [
988988
| ignoreExport | 忽略导出 | `boolean` | `false` | `true` `false` | `2.10.0` |
989989
| totalRow | 开启统计(传`number` `string`则直接展示) | `boolean` `string` `number` | `false` | | |
990990
| totalRowMethod | 自定义统计 | `function` 参数{column, dataSource } | | | |
991+
| exportCellType | `DefaultToolbar.export` 导出控制单元格类型 | `string` | `x:str` | [type](https://learn.microsoft.com/en-us/previous-versions/office/developer/office-xp/aa140066(v=office.10)) | |
991992

992993
:::
993994

packages/component/component/table/hooks/useToolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function useToolBar(props: TableToolBarType) {
8585
// 则不再进行结构拼接。
8686
if (rowspan !== 0 && colspan !== 0) {
8787
const text = columnData ? columnData[tableColumn.key] : "";
88-
const xType = isNumber(text) ? "ss:Type='Number'" : "x:str";
88+
const xType = tableColumn.exportCellType ?? (isNumber(text) ? "ss:Type='Number'" : "x:str");
8989

9090
tableStr += `<td colspan=${colspan} rowspan=${rowspan} ${xType}>${text}</td>`;
9191
}

packages/component/component/table/typing.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ interface TableBaseColumn {
9494
column: TableColumn,
9595
dataSource: TableProps["dataSource"]
9696
) => void;
97+
exportCellType?: string;
9798
}
9899

99100
export type TableColumn =

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy