Skip to content

Commit

Permalink
feat(Cascader): add placeholder attr
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Feb 7, 2024
1 parent 057deb5 commit 9e07f8a
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 14 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
21 changes: 16 additions & 5 deletions packages/products/tdesign-miniprogram/src/cascader/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@

name | type | default | description | required
-- | -- | -- | -- | --
close-btn | Boolean / Slot | true | \- | N
close-btn | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | Typescript:`KeysType`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
options | Array | [] | Typescript:`Array<CascaderOption>` | N
style | String | - | \- | N
title | String / Slot | - | \- | N
value | String / Number | null | Typescript:`null` | N
default-value | String / Number | undefined | uncontrolled property。Typescript:`null` | N
placeholder | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
sub-titles | Array | [] | Typescript:`Array<string>` | N
theme | String | step | options: step/tab | N
title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
value | String / Number | null | \- | N
default-value | String / Number | undefined | uncontrolled property | N
visible | Boolean | false | \- | N

### Cascader Events

name | params | description
-- | -- | --
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`
close | `(trigger: TriggerSource)` | `1.0.1`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, index: number)` | `1.0.1`
21 changes: 16 additions & 5 deletions packages/products/tdesign-miniprogram/src/cascader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
close-btn | Boolean / Slot | true | 关闭按钮 | N
close-btn | Boolean / Slot | true | 关闭按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
style | String | - | 自定义组件样式 | N
title | String / Slot | - | 标题 | N
value | String / Number | null | 选项值。TS 类型:`null` | N
default-value | String / Number | undefined | 选项值。非受控属性。TS 类型:`null` | N
placeholder | String / Slot | - | 未选中时的提示文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
sub-titles | Array | [] | 每级展示的次标题。TS 类型:`Array<string>` | N
theme | String | step | 展示风格。可选项:step/tab | N
title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
value | String / Number | null | 选项值 | N
default-value | String / Number | undefined | 选项值。非受控属性 | N
visible | Boolean | false | 是否展示 | N

### Cascader Events

名称 | 参数 | 描述
-- | -- | --
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`。值发生变更时触发
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, index: number)` | `1.0.1`。选择后触发
90 changes: 86 additions & 4 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -17422,6 +17422,47 @@
"Boolean"
]
},
{
"id": 1707279597,
"platform_framework": [
"8",
"16",
"32"
],
"component": "Cascader",
"field_category": 1,
"field_name": "checkStrictly",
"field_type": [
"4"
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "父子节点选中状态不再关联,可各自选中或取消",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2024-02-07 04:19:57",
"update_time": "2024-02-07 04:19:57",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)"
],
"field_type_text": [
"Boolean"
]
},
{
"id": 388,
"platform_framework": [
Expand Down Expand Up @@ -17927,7 +17968,6 @@
{
"id": 3538,
"platform_framework": [
"8",
"16",
"32"
],
Expand Down Expand Up @@ -17957,7 +17997,6 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)"
],
Expand Down Expand Up @@ -18009,7 +18048,6 @@
{
"id": 3537,
"platform_framework": [
"8",
"16",
"32"
],
Expand Down Expand Up @@ -18039,7 +18077,6 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)"
],
Expand Down Expand Up @@ -18385,6 +18422,51 @@
"String"
]
},
{
"id": 1707279644,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "Cascader",
"field_category": 1,
"field_name": "placeholder",
"field_type": [
"1",
"64"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "未选中时的提示文案",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2024-02-07 04:20:44",
"update_time": "2024-02-07 04:20:44",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
"String",
"TNode"
]
},
{
"id": 398,
"platform_framework": [
Expand Down

0 comments on commit 9e07f8a

Please sign in to comment.