From f57b3e7168467c53ec72de8c785b16315cdd9c85 Mon Sep 17 00:00:00 2001 From: sheepluo Date: Wed, 11 May 2022 15:42:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(table):=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=EF=BC=9B=E6=94=AF=E6=8C=81=E9=9A=90=E8=97=8F=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=96=87=E6=9C=AC=E6=8F=90=E7=A4=BA=20(#863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(notification): 插件调用与函数式调用 * fix(table): merged cells border style * feat(table): 支持自定义树形结构图标;支持隐藏排序文本提示 * feat(table): update common Co-authored-by: sheepluo --- examples/config-provider/config-provider.md | 158 +++---- examples/config-provider/demos/table.vue | 3 +- examples/table/demos/single-sort.vue | 8 +- examples/table/demos/tree.vue | 11 + examples/table/table.md | 7 +- src/config-provider/type.ts | 321 +++++++------- src/config-provider/useConfig.tsx | 6 +- src/table/enhanced-table-props.ts | 4 + src/table/hooks/useSorter.tsx | 1 + src/table/hooks/useTreeData.tsx | 36 +- src/table/primary-table-props.ts | 6 +- src/table/primary-table.tsx | 1 + src/table/sorter-button.tsx | 2 + src/table/type.ts | 17 +- test/ssr/__snapshots__/ssr.test.js.snap | 57 +-- .../table/__snapshots__/demo.test.js.snap | 391 +++++++++++------- 16 files changed, 575 insertions(+), 454 deletions(-) diff --git a/examples/config-provider/config-provider.md b/examples/config-provider/config-provider.md index d64d11668..459bdf751 100644 --- a/examples/config-provider/config-provider.md +++ b/examples/config-provider/config-provider.md @@ -30,20 +30,19 @@ tree | Object | - | 树组件全局配置。TS 类型:`TreeConfig` | N treeSelect | Object | - | 树选择器组件全局配置。TS 类型:`TreeSelectConfig` | N upload | Object | - | 上传组件全局配置。TS 类型:`UploadConfig` | N -### InputConfig +### TreeSelectConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -placeholder | String | - | 语言配置,“请输入”占位符描述文本 | N +empty | String | - | 语言配置,“暂无数据”描述文本 | N +loadingText | String | - | 语言配置,“加载中”描述文本 | N +placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N -### PaginationConfig +### InputConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -itemsPerPage | String | - | 语言配置,每页条数文本,示例:`'{size} 条/页'` | N -jumpTo | String | - | 语言配置,页码跳转文本,示例:'跳至' | N -page | String | - | 语言配置,“页”描述文本 | N -total | String | - | 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` | N +placeholder | String | - | 语言配置,“请输入”占位符描述文本 | N ### CalendarConfig @@ -79,23 +78,19 @@ clearConfirmText | String | - | 语言配置,“确定清空最近使用的颜 recentColorTitle | String | - | 语言配置,“最近使用颜色” 区域标题文本 | N swatchColorTitle | String | - | 语言配置,"系统预设颜色" 区域标题文本 | N -### TransferConfig +### AnchorConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”空数据描述文本 | N -placeholder | String | - | 语言配置,“请输入关键词搜索”占位符描述文本 | N -title | String | - | 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” | N +copySuccessText | String | - | 语言配置,“链接复制成功”描述文本 | N +copyText | String | - | 语言配置,“复制链接” 描述文本 | N -### TimePickerConfig +### AlertConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -anteMeridiem | String | - | 语言配置,“上午”描述文本 | N -confirm | String | - | 语言配置,“确定”描述文本 | N -now | String | - | 语言配置,“此刻”描述文本 | N -placeholder | String | - | 语言配置,"请选择时间"占位符描述文本 | N -postMeridiem | String | - | 语言配置,“下午”描述文本 | N +collapseText | String | - | 语言配置,“收起”描述文本 | N +expandText | String | - | 语言配置,“展开更多”描述文本 | N ### DatePickerConfig @@ -139,6 +134,39 @@ confirmBtnTheme | Object | - | 确认按钮主题色,即 Dialog 的 `theme` cancel | String | - | 语言配置,“取消”描述文本。TS 类型:`string | ButtonProps` | N confirm | String | - | 语言配置,“确认”描述文本。TS 类型:`string | ButtonProps` | N +### FormConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage`,[Form API Documents](./form?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N +requiredMark | Boolean | true | 是否显示必填符号(*),默认显示 | N + +### UploadConfigFileList + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +fileNameText | String | - | 语言配置,“文件名” 描述文本 | N +fileOperationDateText | String | - | 语言配置,“上传日期” 描述文本 | N +fileOperationText | String | - | 语言配置,“操作” 描述文本 | N +fileSizeText | String | - | 语言配置,“文件尺寸” 描述文本 | N +fileStatusText | String | - | 语言配置,“状态” 描述文本 | N + +### ListConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +loadingMoreText | String | - | 语言配置,'点击加载更多' 描述文本 | N +loadingText | String | - | 语言配置,'正在加载中,请稍后' 描述文本 | N + +### PaginationConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +itemsPerPage | String | - | 语言配置,每页条数文本,示例:`'{size} 条/页'` | N +jumpTo | String | - | 语言配置,页码跳转文本,示例:'跳至' | N +page | String | - | 语言配置,“页”描述文本 | N +total | String | - | 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` | N + ### PopconfirmConfig 名称 | 类型 | 默认值 | 说明 | 必传 @@ -158,8 +186,9 @@ columnConfigDescriptionText | String | - | 语言配置,“请选择需要在 columnConfigTitleText | String | - | 语言配置,“表格列配置” 描述文本,列配置功能中弹框的标题 | N confirmText | String | - | 语言配置,“确认” 描述文本 | N empty | String / Slot / Function | - | 语言配置,“暂无数据” 描述文本。TS 类型:`string | TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -expandIcon | Slot / Function | undefined | 展开和收起图标(配置传入收起图标即可),如果没有配置,组件会内置默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -filterIcon | Slot / Function | undefined | 过滤图标,如果没有配置,组件会内置默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +expandIcon | Slot / Function | undefined | 展开和收起图标(配置传入收起图标即可),如果没有配置,会使用组件内置的默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +filterIcon | Slot / Function | undefined | 过滤图标,如果没有配置,会使用组件内置的默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +hideSortTips | Boolean | false | 隐藏排序文本提示 | N loadingMoreText | String | - | 语言配置,“点击加载更多” 描述文本 | N loadingText | String | - | 语言配置,“正在加载中,请稍后” 描述文本 | N resetText | String | - | 语言配置,“重置” 描述文本 | N @@ -168,7 +197,14 @@ selectAllText | String | - | 语言配置,'全选' 描述文本 | N sortAscendingOperationText | String | - | 语言配置,'点击升序' 描述文本 | N sortCancelOperationText | String | - | 语言配置,'点击取消排序' 描述文本 | N sortDescendingOperationText | String | - | 语言配置,'点击降序' 描述文本 | N -sortIcon | Slot / Function | undefined | 排序图标(配置传入降序图标即可),如果没有配置,组件会内置默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +sortIcon | Slot / Function | undefined | 排序图标(配置传入降序图标即可),如果没有配置,会使用组件内置的默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +treeExpandAndFoldIcon | Function | undefined | 树形结构,展开和折叠图标。如果没有配置,会使用组件内置的默认图标。TS 类型:`TNode<{ type: 'expand' | 'fold' }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N + +### StepsConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +errorIcon | Slot / Function | - | 错误步骤图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N ### SelectConfig @@ -179,27 +215,36 @@ empty | String | - | 语言配置,“暂无数据”描述文本 | N loadingText | String | - | 语言配置,“加载中”描述文本 | N placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N -### TreeConfig +### TagConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”描述文本 | N -folderIcon | Function | - | 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +closeIcon | Function | - | 关闭图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -### TreeSelectConfig +### TimePickerConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”描述文本 | N -loadingText | String | - | 语言配置,“加载中”描述文本 | N -placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N +anteMeridiem | String | - | 语言配置,“上午”描述文本 | N +confirm | String | - | 语言配置,“确定”描述文本 | N +now | String | - | 语言配置,“此刻”描述文本 | N +placeholder | String | - | 语言配置,"请选择时间"占位符描述文本 | N +postMeridiem | String | - | 语言配置,“下午”描述文本 | N -### ListConfig +### TransferConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -loadingMoreText | String | - | 语言配置,'点击加载更多' 描述文本 | N -loadingText | String | - | 语言配置,'正在加载中,请稍后' 描述文本 | N +empty | String | - | 语言配置,“暂无数据”空数据描述文本 | N +placeholder | String | - | 语言配置,“请输入关键词搜索”占位符描述文本 | N +title | String | - | 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” | N + +### TreeConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +empty | String | - | 语言配置,“暂无数据”描述文本 | N +folderIcon | Function | - | 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N ### UploadConfig @@ -212,15 +257,6 @@ progress | Object | - | 语言配置,上传进度相关。示例:{ uploadTex sizeLimitMessage | String | - | 语言配置,文件大小超出限制时提醒文本。示例:`'文件大小不能超过 {sizeLimit}'` | N triggerUploadText | Object | - | 语言配置,上传功能触发文案。示例:{ image: '点击上传图片', normal: '点击上传', fileInput: '选择文件',reupload: '重新上传',fileInput: '删除' }。TS 类型:`UploadTriggerUploadText` `interface UploadTriggerUploadText { image?: string, normal?: string, fileInput?: string, reupload?: string, continueUpload: string, delete?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N -### UploadConfigProgress - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -failText | String | - | 语言配置,“上传失败”文本描述 | N -successText | String | - | 语言配置,“上传成功”文本描述 | N -uploadingText | String | - | 语言配置,“上传中”文本描述 | N -waitingText | String | - | 语言配置,“待上传”文本描述 | N - ### UploadConfigDragger 名称 | 类型 | 默认值 | 说明 | 必传 @@ -229,45 +265,11 @@ clickAndDragText | String | - | 语言配置,“ 点击上方“选择文件 dragDropText | String | - | 语言配置,“释放图标” 描述文本 | N draggingText | String | - | 语言配置,'拖拽到此区域' 描述文本 | N -### UploadConfigFileList - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -fileNameText | String | - | 语言配置,“文件名” 描述文本 | N -fileOperationDateText | String | - | 语言配置,“上传日期” 描述文本 | N -fileOperationText | String | - | 语言配置,“操作” 描述文本 | N -fileSizeText | String | - | 语言配置,“文件尺寸” 描述文本 | N -fileStatusText | String | - | 语言配置,“状态” 描述文本 | N - -### FormConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage`,[Form API Documents](./form?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N -requiredMark | Boolean | true | 是否显示必填符号(*),默认显示 | N - -### TagConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -closeIcon | Function | - | 关闭图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N - -### StepsConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -errorIcon | Slot / Function | - | 错误步骤图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N - -### AlertConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -collapseText | String | - | 语言配置,“收起”描述文本 | N -expandText | String | - | 语言配置,“展开更多”描述文本 | N - -### AnchorConfig +### UploadConfigProgress 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -copySuccessText | String | - | 语言配置,“链接复制成功”描述文本 | N -copyText | String | - | 语言配置,“复制链接” 描述文本 | N +failText | String | - | 语言配置,“上传失败”文本描述 | N +successText | String | - | 语言配置,“上传成功”文本描述 | N +uploadingText | String | - | 语言配置,“上传中”文本描述 | N +waitingText | String | - | 语言配置,“待上传”文本描述 | N diff --git a/examples/config-provider/demos/table.vue b/examples/config-provider/demos/table.vue index 71e88488e..5888a7d09 100644 --- a/examples/config-provider/demos/table.vue +++ b/examples/config-provider/demos/table.vue @@ -11,7 +11,7 @@ diff --git a/examples/table/table.md b/examples/table/table.md index 7d1b4c5fa..21d8782fa 100644 --- a/examples/table/table.md +++ b/examples/table/table.md @@ -96,17 +96,18 @@ defaultColumnControllerVisible | Boolean | undefined | 是否显示列配置弹 columns | Array | [] | 列配置,泛型 T 指表格数据类型。TS 类型:`Array>` | N displayColumns | Array | - | 列配置功能中,当前显示的列。支持语法糖 `.sync`。TS 类型:`CheckboxGroupValue` | N defaultDisplayColumns | Array | - | 列配置功能中,当前显示的列。非受控属性。TS 类型:`CheckboxGroupValue` | N -dragSort | String | - | 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽,列拖拽功能开发中。`drag-col` 已废弃,请勿使用。可选项:row/row-handler/col/drag-col | N +dragSort | String | - | 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽。`drag-col` 已废弃,请勿使用。可选项:row/row-handler/col/drag-col | N dragSortOptions | Object | - | 拖拽排序扩展参数,具体参数见 [Sortable](https://github.com/SortableJS/Sortable)。TS 类型:`SortableOptions` | N expandedRow | String / Slot / Function | - | 展开行内容,泛型 T 指表格数据类型。TS 类型:`TNode>` `interface TableExpandedRowParams { row: T; index: number; columns: PrimaryTableCol[] | BaseTableCol[] }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N expandedRowKeys | Array | [] | 展开行。支持语法糖 `.sync`。TS 类型:`Array` | N defaultExpandedRowKeys | Array | [] | 展开行。非受控属性。TS 类型:`Array` | N -expandIcon | Boolean / Slot / Function | true | 用于控制是否显示「展开图标列」,值为 false 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容,示例:`(h, { index }) => index === 0 ? false : `。expandedRow 存在时,该参数有效。支持全局配置 `GlobalConfigProvider`。TS 类型:`boolean | TNode>` `interface ExpandArrowRenderParams { row: T; index: number }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N +expandIcon | Boolean / Slot / Function | true | 用于控制是否显示「展开图标列」,值为 `false` 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容。`expandedRow` 存在时,该参数有效。支持全局配置 `GlobalConfigProvider`。TS 类型:`boolean | TNode>` `interface ExpandArrowRenderParams { row: T; index: number }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N expandOnRowClick | Boolean | - | 是否允许点击行展开 | N filterIcon | Slot / Function | - | 自定义过滤图标,支持全局配置 `GlobalConfigProvider`。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N filterRow | String / Slot / Function | - | 自定义过滤状态行及清空筛选等。TS 类型:`string | TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N filterValue | Object | - | 过滤数据的值。支持语法糖 `.sync`。TS 类型:`FilterValue` `type FilterValue = { [key: string]: any }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N defaultFilterValue | Object | - | 过滤数据的值。非受控属性。TS 类型:`FilterValue` `type FilterValue = { [key: string]: any }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N +hideSortTips | Boolean | - | 隐藏排序文本提示,支持全局配置 `GlobalConfigProvider`,默认全局配置值为 `false` | N multipleSort | Boolean | false | 是否支持多列排序 | N selectedRowKeys | Array | - | 选中的行,控制属性。支持语法糖 `.sync`。TS 类型:`Array` | N defaultSelectedRowKeys | Array | - | 选中的行,控制属性。非受控属性。TS 类型:`Array` | N @@ -149,7 +150,6 @@ sort-change | `(sort: TableSort, options: SortOptions)` | 排序发生变化 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -addToColumnController | Boolean | true | 【开发中】是否允许用户选择是否显示当前列,表格属性 `showColumnController` 为真时有效 | N cell | String / Function | - | 自定义单元格渲染。值类型为 Function 表示以函数形式渲染单元格。值类型为 string 表示使用插槽渲染,插槽名称为 cell 的值。默认使用 colKey 作为插槽名称。优先级高于 render。泛型 T 指表格数据类型。TS 类型:`string | TNode>` `interface PrimaryTableCellParams { row: T; rowIndex: number; col: PrimaryTableCol; colIndex: number }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N checkProps | Object / Function | - | 透传参数,`colKey` 值为 `row-select` 时,配置有效。具体定义参考 Checkbox 组件 和 Radio 组件。泛型 T 指表格数据类型。TS 类型:`CheckProps` `type CheckProps = CheckboxProps | RadioProps | ((options: { row: T; rowIndex: number }) => CheckboxProps | RadioProps)` `import { CheckboxProps } from '@Checkbox'`,[Radio API Documents](./radio?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N children | Array | - | 用于多级表头,泛型 T 指表格数据类型。TS 类型:`Array>` | N @@ -168,6 +168,7 @@ type | String | single | `colKey` 值为 `row-select` 时表示行选中列, 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- tree | Object | - | 树形结构相关配置。`tree.indent` 表示树结点缩进距离,单位:px,默认为 24px。`tree.treeNodeColumnIndex` 表示树结点在第几列渲染,默认为 0 ,第一列。`tree.childrenKey` 表示树形结构子节点字段,默认为 children。`tree.checkStrictly` 表示树形结构的行选中(多选),父子行选中是否独立,默认独立,值为 true。TS 类型:`TableTreeConfig` `interface TableTreeConfig { indent?: number; treeNodeColumnIndex?: number; childrenKey?: 'children'; checkStrictly?: boolean }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N +treeExpandAndFoldIcon | Function | - | 自定义树形结构展开图标,支持全局配置 `GlobalConfigProvider`。TS 类型:`TNode<{ type: 'expand' | 'fold' }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N `PrimaryTableProps` | \- | - | 继承 `PrimaryTableProps` 中的全部 API | N onTreeExpandChange | Function | | TS 类型:`(context: TableTreeExpandChangeContext) => void`
树形结构,用户操作引起节点展开或收起时触发,代码操作不会触发。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts)。
`interface TableTreeExpandChangeContext { row: T; rowIndex: number; rowState: TableRowState }`
| N diff --git a/src/config-provider/type.ts b/src/config-provider/type.ts index 7c396ff24..17c7a2560 100644 --- a/src/config-provider/type.ts +++ b/src/config-provider/type.ts @@ -109,35 +109,30 @@ export interface GlobalConfigProvider { upload?: UploadConfig; } -export interface InputConfig { - /** - * 语言配置,“请输入”占位符描述文本 - * @default '' - */ - placeholder?: string; -} - -export interface PaginationConfig { +export interface TreeSelectConfig { /** - * 语言配置,每页条数文本,示例:`'{size} 条/页'` + * 语言配置,“暂无数据”描述文本 * @default '' */ - itemsPerPage?: string; + empty?: string; /** - * 语言配置,页码跳转文本,示例:'跳至' + * 语言配置,“加载中”描述文本 * @default '' */ - jumpTo?: string; + loadingText?: string; /** - * 语言配置,“页”描述文本 + * 语言配置,“请选择”占位符描述文本 * @default '' */ - page?: string; + placeholder?: string; +} + +export interface InputConfig { /** - * 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` + * 语言配置,“请输入”占位符描述文本 * @default '' */ - total?: string; + placeholder?: string; } export interface CalendarConfig { @@ -243,50 +238,30 @@ export interface ColorPickerConfig { swatchColorTitle?: string; } -export interface TransferConfig { - /** - * 语言配置,“暂无数据”空数据描述文本 - * @default '' - */ - empty?: string; +export interface AnchorConfig { /** - * 语言配置,“请输入关键词搜索”占位符描述文本 + * 语言配置,“链接复制成功”描述文本 * @default '' */ - placeholder?: string; + copySuccessText?: string; /** - * 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” + * 语言配置,“复制链接” 描述文本 * @default '' */ - title?: string; + copyText?: string; } -export interface TimePickerConfig { - /** - * 语言配置,“上午”描述文本 - * @default '' - */ - anteMeridiem?: string; - /** - * 语言配置,“确定”描述文本 - * @default '' - */ - confirm?: string; - /** - * 语言配置,“此刻”描述文本 - * @default '' - */ - now?: string; +export interface AlertConfig { /** - * 语言配置,"请选择时间"占位符描述文本 + * 语言配置,“收起”描述文本 * @default '' */ - placeholder?: string; + collapseText?: string; /** - * 语言配置,“下午”描述文本 + * 语言配置,“展开更多”描述文本 * @default '' */ - postMeridiem?: string; + expandText?: string; } export interface DatePickerConfig { @@ -426,6 +401,82 @@ export interface DrawerConfig { confirm?: string | ButtonProps; } +export interface FormConfig { + /** + * 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }` + */ + errorMessage?: FormErrorMessage; + /** + * 是否显示必填符号(*),默认显示 + * @default true + */ + requiredMark?: boolean; +} + +export interface UploadConfigFileList { + /** + * 语言配置,“文件名” 描述文本 + * @default '' + */ + fileNameText?: string; + /** + * 语言配置,“上传日期” 描述文本 + * @default '' + */ + fileOperationDateText?: string; + /** + * 语言配置,“操作” 描述文本 + * @default '' + */ + fileOperationText?: string; + /** + * 语言配置,“文件尺寸” 描述文本 + * @default '' + */ + fileSizeText?: string; + /** + * 语言配置,“状态” 描述文本 + * @default '' + */ + fileStatusText?: string; +} + +export interface ListConfig { + /** + * 语言配置,'点击加载更多' 描述文本 + * @default '' + */ + loadingMoreText?: string; + /** + * 语言配置,'正在加载中,请稍后' 描述文本 + * @default '' + */ + loadingText?: string; +} + +export interface PaginationConfig { + /** + * 语言配置,每页条数文本,示例:`'{size} 条/页'` + * @default '' + */ + itemsPerPage?: string; + /** + * 语言配置,页码跳转文本,示例:'跳至' + * @default '' + */ + jumpTo?: string; + /** + * 语言配置,“页”描述文本 + * @default '' + */ + page?: string; + /** + * 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` + * @default '' + */ + total?: string; +} + export interface PopconfirmConfig { /** * 语言配置,“取消”描述文本 @@ -477,13 +528,18 @@ export interface TableConfig { */ empty?: string | TNode; /** - * 展开和收起图标(配置传入收起图标即可),如果没有配置,组件会内置默认图标 + * 展开和收起图标(配置传入收起图标即可),如果没有配置,会使用组件内置的默认图标 */ expandIcon?: TNode; /** - * 过滤图标,如果没有配置,组件会内置默认图标 + * 过滤图标,如果没有配置,会使用组件内置的默认图标 */ filterIcon?: TNode; + /** + * 隐藏排序文本提示 + * @default false + */ + hideSortTips?: boolean; /** * 语言配置,“点击加载更多” 描述文本 * @default '' @@ -525,9 +581,20 @@ export interface TableConfig { */ sortDescendingOperationText?: string; /** - * 排序图标(配置传入降序图标即可),如果没有配置,组件会内置默认图标 + * 排序图标(配置传入降序图标即可),如果没有配置,会使用组件内置的默认图标 */ sortIcon?: TNode; + /** + * 树形结构,展开和折叠图标。如果没有配置,会使用组件内置的默认图标 + */ + treeExpandAndFoldIcon?: TNode<{ type: 'expand' | 'fold' }>; +} + +export interface StepsConfig { + /** + * 错误步骤图标,【注意】使用渲染函数输出图标组件 + */ + errorIcon?: TNode; } export interface SelectConfig { @@ -552,47 +619,69 @@ export interface SelectConfig { placeholder?: string; } -export interface TreeConfig { +export interface TagConfig { /** - * 语言配置,“暂无数据”描述文本 + * 关闭图标,【注意】使用渲染函数输出图标组件 + */ + closeIcon?: TNode; +} + +export interface TimePickerConfig { + /** + * 语言配置,“上午”描述文本 * @default '' */ - empty?: string; + anteMeridiem?: string; /** - * 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件 + * 语言配置,“确定”描述文本 + * @default '' */ - folderIcon?: TNode; + confirm?: string; + /** + * 语言配置,“此刻”描述文本 + * @default '' + */ + now?: string; + /** + * 语言配置,"请选择时间"占位符描述文本 + * @default '' + */ + placeholder?: string; + /** + * 语言配置,“下午”描述文本 + * @default '' + */ + postMeridiem?: string; } -export interface TreeSelectConfig { +export interface TransferConfig { /** - * 语言配置,“暂无数据”描述文本 + * 语言配置,“暂无数据”空数据描述文本 * @default '' */ empty?: string; /** - * 语言配置,“加载中”描述文本 + * 语言配置,“请输入关键词搜索”占位符描述文本 * @default '' */ - loadingText?: string; + placeholder?: string; /** - * 语言配置,“请选择”占位符描述文本 + * 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” * @default '' */ - placeholder?: string; + title?: string; } -export interface ListConfig { +export interface TreeConfig { /** - * 语言配置,'点击加载更多' 描述文本 + * 语言配置,“暂无数据”描述文本 * @default '' */ - loadingMoreText?: string; + empty?: string; /** - * 语言配置,'正在加载中,请稍后' 描述文本 - * @default '' + * 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件 */ - loadingText?: string; + folderIcon?: TNode; } export interface UploadConfig { @@ -624,29 +713,6 @@ export interface UploadConfig { triggerUploadText?: UploadTriggerUploadText; } -export interface UploadConfigProgress { - /** - * 语言配置,“上传失败”文本描述 - * @default '' - */ - failText?: string; - /** - * 语言配置,“上传成功”文本描述 - * @default '' - */ - successText?: string; - /** - * 语言配置,“上传中”文本描述 - * @default '' - */ - uploadingText?: string; - /** - * 语言配置,“待上传”文本描述 - * @default '' - */ - waitingText?: string; -} - export interface UploadConfigDragger { /** * 语言配置,“ 点击上方“选择文件”或将文件拖到此区域 ” 描述文本 @@ -665,84 +731,27 @@ export interface UploadConfigDragger { draggingText?: string; } -export interface UploadConfigFileList { - /** - * 语言配置,“文件名” 描述文本 - * @default '' - */ - fileNameText?: string; - /** - * 语言配置,“上传日期” 描述文本 - * @default '' - */ - fileOperationDateText?: string; - /** - * 语言配置,“操作” 描述文本 - * @default '' - */ - fileOperationText?: string; - /** - * 语言配置,“文件尺寸” 描述文本 - * @default '' - */ - fileSizeText?: string; - /** - * 语言配置,“状态” 描述文本 - * @default '' - */ - fileStatusText?: string; -} - -export interface FormConfig { - /** - * 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }` - */ - errorMessage?: FormErrorMessage; - /** - * 是否显示必填符号(*),默认显示 - * @default true - */ - requiredMark?: boolean; -} - -export interface TagConfig { - /** - * 关闭图标,【注意】使用渲染函数输出图标组件 - */ - closeIcon?: TNode; -} - -export interface StepsConfig { - /** - * 错误步骤图标,【注意】使用渲染函数输出图标组件 - */ - errorIcon?: TNode; -} - -export interface AlertConfig { +export interface UploadConfigProgress { /** - * 语言配置,“收起”描述文本 + * 语言配置,“上传失败”文本描述 * @default '' */ - collapseText?: string; + failText?: string; /** - * 语言配置,“展开更多”描述文本 + * 语言配置,“上传成功”文本描述 * @default '' */ - expandText?: string; -} - -export interface AnchorConfig { + successText?: string; /** - * 语言配置,“链接复制成功”描述文本 + * 语言配置,“上传中”文本描述 * @default '' */ - copySuccessText?: string; + uploadingText?: string; /** - * 语言配置,“复制链接” 描述文本 + * 语言配置,“待上传”文本描述 * @default '' */ - copyText?: string; + waitingText?: string; } export type AnimationType = 'ripple' | 'expand' | 'fade'; diff --git a/src/config-provider/useConfig.tsx b/src/config-provider/useConfig.tsx index 3abc7a3b6..44002054d 100644 --- a/src/config-provider/useConfig.tsx +++ b/src/config-provider/useConfig.tsx @@ -28,7 +28,8 @@ export function useConfig(componentName?: const classPrefix = computed(() => mergedGlobalConfig.value.classPrefix); // 处理正则表达式 - const t = function (pattern: T, data?: Record) { + const t = function (pattern: T, ...args: any[]) { + const [data] = args; if (typeof pattern === 'string') { if (!data) return pattern; const regular = /\{\s*([\w-]+)\s*\}/g; @@ -42,7 +43,8 @@ export function useConfig(componentName?: } if (typeof pattern === 'function') { // 重要:组件的渲染必须存在参数 h,不能移除 - return pattern(data ?? h); + if (!args.length) return pattern(h); + return pattern(...args); } return ''; }; diff --git a/src/table/enhanced-table-props.ts b/src/table/enhanced-table-props.ts index 4af017638..34d0ed220 100644 --- a/src/table/enhanced-table-props.ts +++ b/src/table/enhanced-table-props.ts @@ -12,6 +12,10 @@ export default { tree: { type: Object as PropType, }, + /** 自定义树形结构展开图标,支持全局配置 `GlobalConfigProvider` */ + treeExpandAndFoldIcon: { + type: Function as PropType, + }, /** 树形结构,用户操作引起节点展开或收起时触发,代码操作不会触发 */ onTreeExpandChange: Function as PropType, }; diff --git a/src/table/hooks/useSorter.tsx b/src/table/hooks/useSorter.tsx index 56f81a8a3..f1948fed1 100644 --- a/src/table/hooks/useSorter.tsx +++ b/src/table/hooks/useSorter.tsx @@ -140,6 +140,7 @@ export default function useSorter(props: TdPrimaryTableProps, { emit, slots }: S sortType: col.sortType, sortOrder: getSortOrder(sortMap.value[col.colKey]?.descending), sortIcon: props.sortIcon, + hideSortTips: props.hideSortTips, }; return ( ); const treeNodeCol = ref(); const dataSource = ref([]); const { tableTreeClasses } = useClassName(); + const renderTNode = useTNodeDefault(); const rowDataKeys = computed(() => ({ rowKey: props.rowKey || 'id', childrenKey: props.tree?.childrenKey || 'children', })); + function getFoldIcon(h: CreateElement) { + const params = { type: 'fold' }; + const defaultFoldIcon = t(global.value.treeExpandAndFoldIcon, h, params) || ; + return renderTNode('treeExpandAndFoldIcon', { + defaultNode: defaultFoldIcon, + params, + }); + } + + function getExpandIcon(h: CreateElement) { + const params = { type: 'expand' }; + const defaultExpandIcon = t(global.value.treeExpandAndFoldIcon, h, params) || ; + return renderTNode('treeExpandAndFoldIcon', { + defaultNode: defaultExpandIcon, + params, + }); + } + watch( [data], ([data]) => { @@ -114,16 +137,15 @@ export default function useTreeData(props: TdEnhancedTableProps, context: SetupC const classes = { [tableTreeClasses.inlineCol]: !!col.ellipsis }; const childrenNodes = get(p.row, rowDataKeys.value.childrenKey); if (childrenNodes && childrenNodes instanceof Array) { - const IconNode = store.value.treeDataMap.get(get(p.row, rowDataKeys.value.rowKey))?.expanded - ? MinusRectangleIcon - : AddRectangleIcon; + const iconNode = store.value.treeDataMap.get(get(p.row, rowDataKeys.value.rowKey))?.expanded + ? getFoldIcon(h) + : getExpandIcon(h); return (
{!!childrenNodes.length && ( - toggleExpandData({ row: p.row, rowIndex: p.rowIndex, trigger: 'inner' })} - /> + toggleExpandData({ ...p, trigger: 'inner' })}> + {iconNode} + )} {cellInfo}
diff --git a/src/table/primary-table-props.ts b/src/table/primary-table-props.ts index 8df4bf2dc..a3d01ffd0 100644 --- a/src/table/primary-table-props.ts +++ b/src/table/primary-table-props.ts @@ -40,7 +40,7 @@ export default { defaultDisplayColumns: { type: Array as PropType, }, - /** 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽,列拖拽功能开发中。`drag-col` 已废弃,请勿使用 */ + /** 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽。`drag-col` 已废弃,请勿使用 */ dragSort: { type: String as PropType, validator(val: TdPrimaryTableProps['dragSort']): boolean { @@ -66,7 +66,7 @@ export default { type: Array as PropType, default: (): TdPrimaryTableProps['defaultExpandedRowKeys'] => [], }, - /** 用于控制是否显示「展开图标列」,值为 false 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容,示例:`(h, { index }) => index === 0 ? false : `。expandedRow 存在时,该参数有效。支持全局配置 `GlobalConfigProvider` */ + /** 用于控制是否显示「展开图标列」,值为 `false` 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容。`expandedRow` 存在时,该参数有效。支持全局配置 `GlobalConfigProvider` */ expandIcon: { type: [Boolean, Function] as PropType, default: true, @@ -90,6 +90,8 @@ export default { defaultFilterValue: { type: Object as PropType, }, + /** 隐藏排序文本提示,支持全局配置 `GlobalConfigProvider`,默认全局配置值为 `false` */ + hideSortTips: Boolean, /** 是否支持多列排序 */ multipleSort: Boolean, /** 选中的行,控制属性 */ diff --git a/src/table/primary-table.tsx b/src/table/primary-table.tsx index b582d4a94..3d87b09be 100644 --- a/src/table/primary-table.tsx +++ b/src/table/primary-table.tsx @@ -22,6 +22,7 @@ import useClassName from './hooks/useClassName'; export { BASE_TABLE_ALL_EVENTS } from './base-table'; const OMIT_PROPS = [ + 'hideSortTips', 'dragSort', 'defaultExpandedRowKeys', 'columnController', diff --git a/src/table/sorter-button.tsx b/src/table/sorter-button.tsx index b04744ee5..e1b378a7c 100644 --- a/src/table/sorter-button.tsx +++ b/src/table/sorter-button.tsx @@ -21,6 +21,7 @@ export default defineComponent({ }, sortIcon: Function as PropType, tooltipProps: Object as PropType, + hideSortTips: Boolean, }, setup(props, context) { @@ -74,6 +75,7 @@ export default defineComponent({ const activeClass = direction === this.sortOrder ? tableSortClasses.iconActive : tableSortClasses.iconDefault; const cancelTips = this.global.sortCancelOperationText; const tips = direction === this.sortOrder ? cancelTips : tooltips[direction]; + if (this.hideSortTips ?? this.global.hideSortTips) return this.getSortIcon(direction, activeClass); return ( */ defaultDisplayColumns?: CheckboxGroupValue; /** - * 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽,列拖拽功能开发中。`drag-col` 已废弃,请勿使用 + * 拖拽排序方式,值为 `row` 表示行拖拽排序,这种方式无法进行文本复制,慎用。值为`row-handler` 表示通过专门的 拖拽手柄 进行 行拖拽排序。值为 `col` 表示列顺序拖拽。`drag-col` 已废弃,请勿使用 */ dragSort?: 'row' | 'row-handler' | 'col' | 'drag-col'; /** @@ -328,7 +328,7 @@ export interface TdPrimaryTableProps */ defaultExpandedRowKeys?: Array; /** - * 用于控制是否显示「展开图标列」,值为 false 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容,示例:`(h, { index }) => index === 0 ? false : `。expandedRow 存在时,该参数有效。支持全局配置 `GlobalConfigProvider` + * 用于控制是否显示「展开图标列」,值为 `false` 则不会显示。可以精确到某一行是否显示,还可以自定义展开图标内容。`expandedRow` 存在时,该参数有效。支持全局配置 `GlobalConfigProvider` * @default true */ expandIcon?: boolean | TNode>; @@ -352,6 +352,10 @@ export interface TdPrimaryTableProps * 过滤数据的值,非受控属性 */ defaultFilterValue?: FilterValue; + /** + * 隐藏排序文本提示,支持全局配置 `GlobalConfigProvider`,默认全局配置值为 `false` + */ + hideSortTips?: boolean; /** * 是否支持多列排序 * @default false @@ -435,11 +439,6 @@ export interface TdPrimaryTableProps export interface PrimaryTableCol extends Omit { - /** - * 【开发中】是否允许用户选择是否显示当前列,表格属性 `showColumnController` 为真时有效 - * @default true - */ - addToColumnController?: boolean; /** * 自定义单元格渲染。值类型为 Function 表示以函数形式渲染单元格。值类型为 string 表示使用插槽渲染,插槽名称为 cell 的值。默认使用 colKey 作为插槽名称。优先级高于 render。泛型 T 指表格数据类型 */ @@ -495,6 +494,10 @@ export interface TdEnhancedTableProps ext * 树形结构相关配置。`tree.indent` 表示树结点缩进距离,单位:px,默认为 24px。`tree.treeNodeColumnIndex` 表示树结点在第几列渲染,默认为 0 ,第一列。`tree.childrenKey` 表示树形结构子节点字段,默认为 children。`tree.checkStrictly` 表示树形结构的行选中(多选),父子行选中是否独立,默认独立,值为 true */ tree?: TableTreeConfig; + /** + * 自定义树形结构展开图标,支持全局配置 `GlobalConfigProvider` + */ + treeExpandAndFoldIcon?: TNode<{ type: 'expand' | 'fold' }>; /** * 树形结构,用户操作引起节点展开或收起时触发,代码操作不会触发 */ diff --git a/test/ssr/__snapshots__/ssr.test.js.snap b/test/ssr/__snapshots__/ssr.test.js.snap index 55790be35..4ffb16ca2 100644 --- a/test/ssr/__snapshots__/ssr.test.js.snap +++ b/test/ssr/__snapshots__/ssr.test.js.snap @@ -15223,10 +15223,10 @@ exports[`ssr snapshot test renders ./examples/table/demos/show-columns.vue corre exports[`ssr snapshot test renders ./examples/table/demos/single-sort.vue correctly 1`] = `
-

排序:{ - "sortBy": "status", - "descending": true - }

+
排序:{ + "sortBy": "status", + "descending": true +}
@@ -15322,7 +15322,9 @@ exports[`ssr snapshot test renders ./examples/table/demos/single-sort.vue correc exports[`ssr snapshot test renders ./examples/table/demos/tree.vue correctly 1`] = `
-

+

@@ -15379,10 +15381,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree.vue correctly 1`]
-
- - - 我是 1_1 号(第 1 页)
+
我是 1_1 号(第 1 页)
私有 @@ -15397,10 +15396,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree.vue correctly 1`]
-
- - - 我是 2_1 号(第 1 页)
+
我是 2_1 号(第 1 页)
共有 @@ -15415,10 +15411,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree.vue correctly 1`]
-
- - - 我是 3_1 号(第 1 页)
+
我是 3_1 号(第 1 页)
私有 @@ -15433,10 +15426,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree.vue correctly 1`]
-
- - - 我是 4_1 号(第 1 页)
+
我是 4_1 号(第 1 页)
共有 @@ -15529,10 +15519,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree-select.vue correc -
- - - JQTest0
+
JQTest0

健康

@@ -15544,10 +15531,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree-select.vue correc -
- - - JQTest1
+
JQTest1

异常

@@ -15559,10 +15543,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree-select.vue correc -
- - - JQTest2
+
JQTest2

健康

@@ -15574,10 +15555,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree-select.vue correc -
- - - JQTest3
+
JQTest3

异常

@@ -15589,10 +15567,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/tree-select.vue correc -
- - - JQTest4
+
JQTest4

健康

diff --git a/test/unit/table/__snapshots__/demo.test.js.snap b/test/unit/table/__snapshots__/demo.test.js.snap index f76cd6554..c2c5a8dfe 100644 --- a/test/unit/table/__snapshots__/demo.test.js.snap +++ b/test/unit/table/__snapshots__/demo.test.js.snap @@ -18959,12 +18959,34 @@ exports[`Table Table singleSortVue demo works fine 1`] = `
-

- 排序:{ +

+ + + + 排序:{ "sortBy": "status", "descending": true } -

+
+
- - - - + + + + + JQTest0
@@ -19604,24 +19630,28 @@ exports[`Table Table treeSelectVue demo works fine 1`] = ` class="t-table__tree-col" style="padding-left: 1px;" > - - - - + + + + + JQTest1
@@ -19700,24 +19730,28 @@ exports[`Table Table treeSelectVue demo works fine 1`] = ` class="t-table__tree-col" style="padding-left: 1px;" > - - - - + + + + + JQTest2
@@ -19797,24 +19831,28 @@ exports[`Table Table treeSelectVue demo works fine 1`] = ` class="t-table__tree-col" style="padding-left: 1px;" > - - - - + + + + + JQTest3
@@ -19893,24 +19931,28 @@ exports[`Table Table treeSelectVue demo works fine 1`] = ` class="t-table__tree-col" style="padding-left: 1px;" > - - - - + + + + + JQTest4
@@ -19967,6 +20009,27 @@ exports[`Table Table treeVue demo works fine 1`] = ` 展开/收起可见行 + +

@@ -20170,24 +20233,28 @@ exports[`Table Table treeVue demo works fine 1`] = ` class="t-table__tree-col t-table__tree-col--inline" style="padding-left: 1px;" > - - - - + + + + + 我是 1_1 号(第 1 页)
@@ -20273,24 +20340,28 @@ exports[`Table Table treeVue demo works fine 1`] = ` class="t-table__tree-col t-table__tree-col--inline" style="padding-left: 1px;" > - - - - + + + + + 我是 2_1 号(第 1 页) @@ -20376,24 +20447,28 @@ exports[`Table Table treeVue demo works fine 1`] = ` class="t-table__tree-col t-table__tree-col--inline" style="padding-left: 1px;" > - - - - + + + + + 我是 3_1 号(第 1 页) @@ -20479,24 +20554,28 @@ exports[`Table Table treeVue demo works fine 1`] = ` class="t-table__tree-col t-table__tree-col--inline" style="padding-left: 1px;" > - - - - + + + + + 我是 4_1 号(第 1 页)