提交 46fc91aa 编写于 作者: E ester.zhou

update ts-basic-components-textpicker.md

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 6819dad0
# TextPicker # TextPicker
> **NOTE**<br> The **\<TextPicker>** component allows users to select text from a list of options.
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **&lt;TextPicker&gt;** component allows users to select text from a list of options. > **NOTE**
>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions ## Required Permissions
...@@ -15,27 +16,28 @@ None ...@@ -15,27 +16,28 @@ None
## Child Components ## Child Components
None Not supported
## APIs ## APIs
TextPicker(value: {range: string[], selected?: number}) TextPicker(value: {range: string[] | Resource, value?: string, selected?: number})
Creates a text picker based on the selection range specified by **range**. Creates a text picker based on the selection range specified by **range**.
- Parameter - Parameters
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| range | string[] | Yes | - | Data selection range of the picker. | | range | string[]\|&nbsp;[Resource](../../ui/ts-types.md) | Yes | - | Data selection range of the picker. |
| selected | number | No | - | Index value of the selected item in the array. By default, the first element is selected. | | value | string | No | - | Search text. |
| selected | number | No | Index of the first item | Index of the selected item in the array. |
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| defaultPickerItemHeight | Length | - | Default height of a Picker content item element. | | defaultPickerItemHeight | Length | - | Default height of an item in the picker. |
## Events ## Events
...@@ -48,7 +50,8 @@ Creates a text picker based on the selection range specified by **range**. ...@@ -48,7 +50,8 @@ Creates a text picker based on the selection range specified by **range**.
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct TextPickerExample { struct TextPickerExample {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册