-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cascader): add lazy & loadCompleted api
- Loading branch information
Showing
6 changed files
with
292 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
packages/products/tdesign-mobile-vue/src/cascader/cascader.en-US.md
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
### Cascader Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
closeBtn | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
lazy | Boolean | false | \- | N | ||
loadCompleted | Boolean | false | \- | N | ||
options | Array | [] | Typescript:`Array<CascaderOption>` | N | ||
subTitles | Array | [] | Typescript:`Array<string>` | N | ||
theme | String | step | options:step/tab | N | ||
title | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
value | String / Number | - | `v-model` and `v-model:value` is supported | N | ||
defaultValue | String / Number | - | uncontrolled property | N | ||
visible | Boolean | false | \- | N | ||
onChange | Function | | Typescript:`(value: string \| number, selectedOptions: string[]) => void`<br/> | N | ||
onClose | Function | | Typescript:`(trigger: TriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | N | ||
onPick | Function | | Typescript:`(value: string \| number, index: number) => void`<br/> | N | ||
|
||
### Cascader Events | ||
|
||
name | params | description | ||
-- | -- | -- | ||
change | `(value: string \| number, selectedOptions: string[])` | \- | ||
close | `(trigger: TriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | ||
pick | `(value: string \| number, index: number)` | \- |
29 changes: 29 additions & 0 deletions
29
packages/products/tdesign-mobile-vue/src/cascader/cascader.md
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
### Cascader Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
-- | -- | -- | -- | -- | ||
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 | ||
lazy | Boolean | false | 是否异步加载 | N | ||
loadCompleted | Boolean | false | 是否完成异步加载 | N | ||
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | 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 | ||
onChange | Function | | TS 类型:`(value: string \| number, selectedOptions: string[]) => void`<br/>值发生变更时触发 | N | ||
onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`<br/>关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | N | ||
onPick | Function | | TS 类型:`(value: string \| number, index: number) => void`<br/>选择后触发 | N | ||
|
||
### Cascader Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
change | `(value: string \| number, selectedOptions: string[])` | 值发生变更时触发 | ||
close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | ||
pick | `(value: string \| number, index: number)` | 选择后触发 |
53 changes: 53 additions & 0 deletions
53
packages/products/tdesign-mobile-vue/src/radio/radio.en-US.md
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
### Radio Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
align | String | left | options:left/right | N | ||
allowUncheck | Boolean | false | \- | N | ||
block | Boolean | true | \- | N | ||
borderless | Boolean | undefined | \- | N | ||
checked | Boolean | false | `v-model` and `v-model:checked` is supported | N | ||
defaultChecked | Boolean | false | uncontrolled property | N | ||
content | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
contentDisabled | Boolean | - | \- | N | ||
default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
disabled | Boolean | undefined | \- | N | ||
icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| 'loading' \| Array<TNode>`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
label | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
maxContentRow | Number | 5 | \- | N | ||
maxLabelRow | Number | 3 | \- | N | ||
name | String | - | \- | N | ||
placement | String | undefined | options:left/right | N | ||
value | String / Number / Boolean | undefined | Typescript:`string \| number \| boolean` | N | ||
onChange | Function | | Typescript:`(checked: boolean, context: { e: Event }) => void`<br/> | N | ||
|
||
### Radio Events | ||
|
||
name | params | description | ||
-- | -- | -- | ||
change | `(checked: boolean, context: { e: Event })` | \- | ||
|
||
### RadioGroup Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
allowUncheck | Boolean | false | \- | N | ||
borderless | Boolean | false | \- | N | ||
disabled | Boolean | - | \- | N | ||
icon | String / Array | 'circle' | \- | N | ||
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
name | String | - | \- | N | ||
options | Array | - | Typescript:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
placement | String | left | options:left/right | N | ||
value | String / Number / Boolean | - | `v-model` and `v-model:value` is supported。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
onChange | Function | | Typescript:`(value: T, context: { e: Event }) => void`<br/> | N | ||
|
||
### RadioGroup Events | ||
|
||
name | params | description | ||
-- | -- | -- | ||
change | `(value: T, context: { e: Event })` | \- |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
### Radio Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
-- | -- | -- | -- | -- | ||
align | String | left | 已废弃。复选框和内容相对位置。可选项:left/right | N | ||
allowUncheck | Boolean | false | 是否允许取消选中 | N | ||
block | Boolean | true | 是否为块级元素 | N | ||
borderless | Boolean | undefined | 是否开启无边框模式 | N | ||
checked | Boolean | false | 是否选中。支持语法糖 `v-model` 或 `v-model:checked` | N | ||
defaultChecked | Boolean | false | 是否选中。非受控属性 | N | ||
content | String / Slot / Function | - | 单选内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
contentDisabled | Boolean | - | 是否禁用组件内容(content)触发选中 | N | ||
default | String / Slot / Function | - | 单选按钮内容,同 label。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。Radio.disabled 优先级高于 RadioGroup.disabled | N | ||
icon | String / Array | 'circle' | 自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标。TS 类型:`'circle' \| 'line' \| 'dot' \| 'loading' \| Array<TNode>`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
label | String / Slot / Function | - | 主文案。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
maxContentRow | Number | 5 | 内容最大行数限制 | N | ||
maxLabelRow | Number | 3 | 主文案最大行数限制 | N | ||
name | String | - | HTML 元素原生属性 | N | ||
placement | String | undefined | 复选框和内容相对位置。可选项:left/right | N | ||
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`string \| number \| boolean` | N | ||
onChange | Function | | TS 类型:`(checked: boolean, context: { e: Event }) => void`<br/>选中状态变化时触发 | N | ||
|
||
### Radio Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
change | `(checked: boolean, context: { e: Event })` | 选中状态变化时触发 | ||
|
||
### RadioGroup Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
-- | -- | -- | -- | -- | ||
allowUncheck | Boolean | false | 是否允许取消选中 | N | ||
borderless | Boolean | false | 是否开启无边框模式;优先级低于 Radio | N | ||
disabled | Boolean | - | 是否禁用全部子单选框。默认为 false。RadioGroup.disabled 优先级低于 Radio.disabled | N | ||
icon | String / Array | 'circle' | 自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标 | N | ||
keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N | ||
name | String | - | HTML 元素原生属性 | N | ||
options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
placement | String | left | 复选框和内容相对位置。可选项:left/right | N | ||
value | String / Number / Boolean | - | 选中的值。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/radio/type.ts) | N | ||
onChange | Function | | TS 类型:`(value: T, context: { e: Event }) => void`<br/>选中值发生变化时触发 | N | ||
|
||
### RadioGroup Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
change | `(value: T, context: { e: Event })` | 选中值发生变化时触发 |
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