Skip to content

Commit 6786d89

Browse files
jevin98sleeprite
authored andcommitted
!493 chore(table/type): column.sort 补充boolean类型
* chore(table/type): column.sort 补充boolean类型
1 parent 7869dd5 commit 6786d89

File tree

2 files changed

+8
-8
lines changed
  • docs/src/document/zh-CN/components
  • packages/component/component/table

2 files changed

+8
-8
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const page = reactive({ current: 1, limit: 10, total: 100 });
5252

5353
const columns = ref([
5454
{ title:"选项", width: "55px", type: "checkbox", fixed: "left" },
55-
{ title:"编号", width: "80px", key:"id", fixed: "left", sort: "desc" },
56-
{ title:"姓名", width: "80px", key:"name", sort: "desc" },
55+
{ title:"编号", width: "80px", key:"id", fixed: "left", sort: true },
56+
{ title:"姓名", width: "80px", key:"name", sort: true },
5757
{ title:"状态", width: "180px", key:"status", customSlot: "status"},
5858
{ title:"邮箱", width: "120px", key:"email" },
5959
{ title:"性别", width: "80px", key:"sex" },
@@ -152,7 +152,7 @@ const loadDataSource = (page, pageSize) => {
152152
import { ref } from 'vue'
153153

154154
const columns2 = [
155-
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: "desc" },
155+
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: true },
156156
{ title:"姓名", width:"80px", key:"name" },
157157
{ title:"班级", width:"120px", key:"classes" },
158158
{ title:"语文", width:"80px", key:"chinese" },
@@ -787,7 +787,7 @@ const dataSource9 = ref([
787787
import { ref } from 'vue'
788788

789789
const columns2 = [
790-
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: "desc"},
790+
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: true},
791791
{ title:"姓名", width:"80px", key:"name" },
792792
{ title:"班级", width:"120px", key:"classes" },
793793
{
@@ -847,7 +847,7 @@ const defaultExpandAll2 = ref(false)
847847
import { ref } from 'vue'
848848

849849
const columns11 = [
850-
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: "desc"},
850+
{ title:"编号", width:"80px", key:"id", fixed: "left", sort: true},
851851
{ title:"姓名", width:"80px", key:"name" },
852852
]
853853

@@ -926,7 +926,7 @@ const defaultToolbars = [
926926
| row-contextmenu | 行右击 | { row: 当前行数据 } |
927927
| cell-double | 单元格双击 | data:当前单元格信息, event |
928928
| change | 分页事件。<span style="color: red;">将在未来版本废弃,请替换为`page.change`</span> | { current: 当前页码, limit: 每页数量 } |
929-
| sort-change | 排序事件 | sort: string |
929+
| sort-change | 点击排序事件 | key: 当前column.key, nextSort: 排序字段 |
930930
| expand-change `2.18.0` | 行展开/收起 | data:当前单元格信息, event |
931931
| checkbox `2.22.0` | 单行 checkbox 事件 | state: 是否选中, data: 点击行数据源 |
932932
| checkbox-all `2.22.0` | 全选 checkbox 事件 | selectedKeys: 选中数据 |
@@ -974,7 +974,7 @@ const defaultToolbars = [
974974
| customSlot | 自定义插槽 | `string` `function` 参数{row, data, column, rowIndex, columnIndex} | -- | -- | `2.17.2`新增`function` |
975975
| width | 宽度 | -- | -- | -- | -- |
976976
| minWidth | 最小宽度 | -- | `100px` | -- | -- |
977-
| sort | 排序,当值为字符串 `custom` 可通过 `sort-change` 事件自定义/服务端设置排序解结果 | `boolean`/ `string` | `false` | -- | -- |
977+
| sort | 是否排序,当值为字符串 `custom` 不会触发内部排序逻辑,可通过 `sort-change` 事件自定义/服务端设置排序解结果 | `boolean`/ `custom` | `false` | -- | -- |
978978
| titleSlot | 标题自定义插槽 | `string` `function` 参数{column, columnIndex} | -- | -- | `2.22.1`新增`function` |
979979
| align | 对齐方式 | `string` | `left` | `left` `right` `center` | -- |
980980
| ellipsisTooltip | 当内容过长被隐藏时显示 tooltip | `boolean` | `false` | `true` `false` | -- |

packages/component/component/table/typing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ interface TableBaseColumn {
7272
customSlot?: RenderProps["render"];
7373
width?: string;
7474
minWidth?: string;
75-
sort?: string;
75+
sort?: boolean | string;
7676
titleSlot?: RenderProps["render"];
7777
align?: CommonAlign;
7878
ellipsisTooltip?: boolean;

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