Skip to content

Commit 63a6703

Browse files
authored
feat(cascader): add more params for option (#754)
1 parent 00bb86c commit 63a6703

File tree

13 files changed

+16
-16
lines changed

13 files changed

+16
-16
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-react/packages/components/cascader/cascader.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ loadingText | TNode | - | Typescript:`string \| TNode`。[see more ts definiti
2828
max | Number | 0 | \- | N
2929
minCollapsedNum | Number | 0 | \- | N
3030
multiple | Boolean | false | \- | N
31-
option | TElement | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
31+
option | TElement | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
3232
options | Array | [] | Typescript:`Array<CascaderOption>` | N
3333
panelBottomContent | TNode | - | bottom content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
3434
panelTopContent | TNode | - | top content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N

packages/products/tdesign-react/packages/components/cascader/cascader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ loadingText | TNode | - | 远程加载时显示的文字,支持自定义。如
2828
max | Number | 0 | 用于控制多选数量,值为 0 则不限制 | N
2929
minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠选中项,超出该数值的选中项折叠。值为 0 则表示不折叠 | N
3030
multiple | Boolean | false | 是否允许多选 | N
31-
option | TElement | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
31+
option | TElement | - | 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开。TS 类型:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
3232
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
3333
panelBottomContent | TNode | - | 面板内的底部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
3434
panelTopContent | TNode | - | 面板内的顶部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N

packages/products/tdesign-react/packages/components/cascader/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
111111
*/
112112
multiple?: boolean;
113113
/**
114-
* 自定义单个级联选项
114+
* 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开
115115
*/
116-
option?: TNode<{ item: CascaderOption; index: number }>;
116+
option?: TNode<{ item: CascaderOption; index: number; onChange: () => void; onExpand: () => void }>;
117117
/**
118118
* 可选项数据源
119119
* @default []

packages/products/tdesign-vue-next/packages/components/cascader/cascader.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ loadingText | String / Slot / Function | - | Typescript:`string \| TNode`。[s
2626
max | Number | 0 | \- | N
2727
minCollapsedNum | Number | 0 | \- | N
2828
multiple | Boolean | false | \- | N
29-
option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
29+
option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
3030
options | Array | [] | Typescript:`Array<CascaderOption>` | N
3131
panelBottomContent | String / Slot / Function | - | bottom content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
3232
panelTopContent | String / Slot / Function | - | top content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N

packages/products/tdesign-vue-next/packages/components/cascader/cascader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ loadingText | String / Slot / Function | - | 远程加载时显示的文字,
2626
max | Number | 0 | 用于控制多选数量,值为 0 则不限制 | N
2727
minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠选中项,超出该数值的选中项折叠。值为 0 则表示不折叠 | N
2828
multiple | Boolean | false | 是否允许多选 | N
29-
option | Slot / Function | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
29+
option | Slot / Function | - | 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开。TS 类型:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
3030
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
3131
panelBottomContent | String / Slot / Function | - | 面板内的底部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
3232
panelTopContent | String / Slot / Function | - | 面板内的顶部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N

packages/products/tdesign-vue-next/packages/components/cascader/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default {
7878
},
7979
/** 是否允许多选 */
8080
multiple: Boolean,
81-
/** 自定义单个级联选项 */
81+
/** 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开 */
8282
option: {
8383
type: Function as PropType<TdCascaderProps['option']>,
8484
},

packages/products/tdesign-vue-next/packages/components/cascader/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
110110
*/
111111
multiple?: boolean;
112112
/**
113-
* 自定义单个级联选项
113+
* 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开
114114
*/
115-
option?: TNode<{ item: CascaderOption; index: number }>;
115+
option?: TNode<{ item: CascaderOption; index: number; onChange: () => void; onExpand: () => void }>;
116116
/**
117117
* 可选项数据源
118118
* @default []

packages/products/tdesign-vue/src/cascader/cascader.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ loadingText | String / Slot / Function | - | Typescript:`string \| TNode`。[s
2626
max | Number | 0 | \- | N
2727
minCollapsedNum | Number | 0 | \- | N
2828
multiple | Boolean | false | \- | N
29-
option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
29+
option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
3030
options | Array | [] | Typescript:`Array<CascaderOption>` | N
3131
panelBottomContent | String / Slot / Function | - | bottom content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
3232
panelTopContent | String / Slot / Function | - | top content of the cascader panel。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N

packages/products/tdesign-vue/src/cascader/cascader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ loadingText | String / Slot / Function | - | 远程加载时显示的文字,
2626
max | Number | 0 | 用于控制多选数量,值为 0 则不限制 | N
2727
minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠选中项,超出该数值的选中项折叠。值为 0 则表示不折叠 | N
2828
multiple | Boolean | false | 是否允许多选 | N
29-
option | Slot / Function | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
29+
option | Slot / Function | - | 自定义单个级联选项, item 是选项本身的值,index 是下标,onChange 用于触发当前节点选中,onExpand 用于触发当前节点展开。TS 类型:`TNode<{ item: CascaderOption; index: number, onChange: ()=> void, onExpand: ()=> void }>`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
3030
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
3131
panelBottomContent | String / Slot / Function | - | 面板内的底部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
3232
panelTopContent | String / Slot / Function | - | 面板内的顶部内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N

0 commit comments

Comments
 (0)