-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
821 additions
and
946 deletions.
There are no files selected for viewing
712 changes: 308 additions & 404 deletions
712
src/cascader/__test__/__snapshots__/demo.test.jsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Cascader Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N | ||
closeBtn | Boolean / Slot / Function | true | 关闭按钮。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts) | N | ||
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N | ||
placeholder | String / Slot / Function | '选择选项' | 未选中时的提示文案。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
subTitles | Array | [] | 每级展示的次标题。TS 类型:`Array<string>` | N | ||
theme | String | step | 展示风格。可选项:step/tab | N | ||
title | String / Slot / Function | - | 标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
value | String / Number | - | 选项值。支持语法糖 `v-model` 或 `v-model:value` | N | ||
defaultValue | String / Number | - | 选项值。非受控属性 | N | ||
visible | Boolean | false | 是否展示 | N | ||
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N | ||
placeholder | String / Slot / Function | 选择选项 | 未选中时的提示文案。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
onChange | Function | | TS 类型:`(value: string \| number, selectedOptions: string[]) => void`<br/>值发生变更时触发 | N | ||
onChange | Function | | TS 类型:`(value: string \| number, selectedOptions: CascaderOption[]) => void`<br/>值发生变更时触发 | N | ||
onClose | Function | | TS 类型:`(trigger: CascaderTriggerSource) => void`<br/>关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | N | ||
onPick | Function | | TS 类型:`(context: { level: number, value: string \| number, index: number }) => void`<br/>选择后触发 | N | ||
|
||
### Cascader Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
change | `(value: string \| number, selectedOptions: string[])` | 值发生变更时触发 | ||
change | `(value: string \| number, selectedOptions: CascaderOption[])` | 值发生变更时触发 | ||
close | `(trigger: CascaderTriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | ||
pick | `(context: { level: number, value: string \| number, index: number })` | 选择后触发 | ||
|
||
|
||
### CSS Variables | ||
|
||
组件提供了下列 CSS 变量,可用于自定义样式。 | ||
名称 | 默认值 | 描述 | ||
-- | -- | -- | ||
--td-cascader-active-color | @brand-color | - | ||
--td-cascader-border-color | @border-color | - | ||
--td-cascader-disabled-color | @font-gray-4 | - | ||
--td-cascader-options-height | 320px | - | ||
--td-cascader-options-title-color | @font-gray-3 | - | ||
--td-cascader-step-arrow-color | @font-gray-3 | - | ||
--td-cascader-step-dot-size | 8px | - | ||
--td-cascader-step-height | 44px | - | ||
--td-cascader-title-color | @font-gray-1 | - | ||
--td-cascder-title-font-size | 18px | - | ||
| 名称 | 默认值 | 描述 | | ||
| --------------------------------- | ------------- | ---- | | ||
| --td-cascader-active-color | @brand-color | - | | ||
| --td-cascader-border-color | @border-color | - | | ||
| --td-cascader-disabled-color | @font-gray-4 | - | | ||
| --td-cascader-options-height | 320px | - | | ||
| --td-cascader-options-title-color | @font-gray-3 | - | | ||
| --td-cascader-step-arrow-color | @font-gray-3 | - | | ||
| --td-cascader-step-dot-size | 8px | - | | ||
| --td-cascader-step-height | 44px | - | | ||
| --td-cascader-title-color | @font-gray-1 | - | | ||
| --td-cascder-title-font-size | 18px | - | |
Oops, something went wrong.