未验证 提交 cc62d79d 编写于 作者: O openharmony_ci 提交者: Gitee

!7912 翻译完成 7698:ts-basic-components-select.md

Merge pull request !7912 from ester.zhou/TR-7698
# Select # Select
> **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **<Select\>** component provides a drop-down list box that allows users to select among multiple options. The **<Select\>** component provides a drop-down list box that allows users to select among multiple 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
None None
## Child Components ## Child Components
None Not supported
## APIs ## APIs
...@@ -47,22 +48,23 @@ Select(options: Array\<SelectOption>\) ...@@ -47,22 +48,23 @@ Select(options: Array\<SelectOption>\)
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct SelectExample { struct SelectExample {
build() { build() {
Column() { Column() {
Select([{value:'aaa',icon: "/common/1.png"}, Select([{ value: 'aaa', icon: "/common/1.png" },
{value:'bbb',icon: "/common/2.png"}, { value: 'bbb', icon: "/common/2.png" },
{value:'ccc',icon: "/common/3.png"}, { value: 'ccc', icon: "/common/3.png" },
{value:'ddd',icon: "/common/4.png"}]) { value: 'ddd', icon: "/common/4.png" }])
.selected(2) .selected(2)
.value('TTT') .value('TTT')
.font({size: 30, weight:400, family: 'serif', style: FontStyle.Normal }) .font({ size: 30, weight: 400, family: 'serif', style: FontStyle.Normal })
.selectedOptionFont({size: 40, weight: 500, family: 'serif', style: FontStyle.Normal }) .selectedOptionFont({ size: 40, weight: 500, family: 'serif', style: FontStyle.Normal })
.optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal }) .optionFont({ size: 30, weight: 400, family: 'serif', style: FontStyle.Normal })
.onSelecte((index:number)=>{ .onSelect((index: number) => {
console.info("Select:" + index) console.info("Select:" + index)
}) })
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册