diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/select.png b/zh-cn/application-dev/reference/arkui-ts/figures/select.png index 18785385d1126fb1824ee618521a9b95dd621197..2672d45f3ed5685aa6f350c2cade469c065a13af 100644 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/select.png and b/zh-cn/application-dev/reference/arkui-ts/figures/select.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md index cb81abdaad39147e5fb79f1dd62d6afd74351d15..8abad1b866794455905430806916efc749d5b90b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md @@ -1,9 +1,9 @@ -# Slelect +# Select >![](../../public_sys-resources/icon-note.gif) **说明:** >该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 -提供下拉选择按钮,可以让用户在多个选项之间选择。 +提供下拉选择菜单,可以让用户在多个选项之间选择。 ## 权限列表 @@ -33,7 +33,7 @@ Select(options: Array<SelectOption>)

value

-

string | Resource

+

ResourceStr

@@ -42,10 +42,9 @@ Select(options: Array<SelectOption>)

下拉选项内容。

-

icon

+

icon

-

string | Resource

+

ResourceStr

@@ -76,7 +75,7 @@ Select(options: Array<SelectOption>)

-

-

设置下拉菜单选择项序号,从0开始。

+

设置下拉菜单初始选择项的索引,第一项的索引为0。

value

@@ -90,22 +89,16 @@ Select(options: Array<SelectOption>)

font

-

{

-

size?: Length,

-

weight?: number | FontWeight,

-

family?: string,

-

style?: FontStyle

-

}

+

Font

-

-

设置select文本样式:

- +

设置下拉按钮本身的文本样式:

fontColor

-

Color | Resource

+

ResourceColor

-

@@ -114,7 +107,7 @@ Select(options: Array<SelectOption>)

selectedOptionBgColor

-

Color | Resource

+

ResourceColor

-

@@ -123,22 +116,16 @@ Select(options: Array<SelectOption>)

selectedOptionFont

-

{

-

size?: Length,

-

weight?: number | FontWeight,

-

family?: string,

-

style?: FontStyle

-

}

+

Font

-

-

设置已选中option的文本样式:

- +

设置下拉菜单选中项的文本样式:

selectedOptionFontColor

-

Color | Resource

+

ResourceColor

-

@@ -147,7 +134,7 @@ Select(options: Array<SelectOption>)

optionBgColor

-

Color | Resource

+

ResourceColor

-

@@ -156,22 +143,16 @@ Select(options: Array<SelectOption>)

optionFont

-

{

-

size?: Length,

-

weight?: number | FontWeight,

-

family?: string,

-

style?: FontStyle

-

}

+

Font

-

-

设置option文本样式:

- +

设置下拉菜单项的文本样式:

optionFontColor

-

Color | Resource

+

ResourceColor

-

@@ -203,10 +184,10 @@ Select(options: Array<SelectOption>) ## 示例 ``` + @Entry @Component struct SliderExample { - @State index: number = 0 build() { Column() { Select([{value:'aaa',icon: "/common/1.png"}, @@ -215,9 +196,9 @@ struct SliderExample { {value:'ddd',icon: "/common/4.png"}]) .selected(2) .value('TTT') - .font({size: 30, weight:900, family: 'serif', style: FontStyle.Normal }) - .selectedOptionFont({size: 30, weight: 900, family: 'serif', style: FontStyle.Normal }) - .optionFont({size: 30, weight: 900, 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 }) + .optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal }) .onSelected((index:number)=>{ console.info("Select:" + index) }) diff --git a/zh-cn/application-dev/ui/ts-types.md b/zh-cn/application-dev/ui/ts-types.md index cc9fc901beef77b10cc58b62a1a9749f29abf084..82f029423026436a89aced783dbd905e3e7f42bf 100644 --- a/zh-cn/application-dev/ui/ts-types.md +++ b/zh-cn/application-dev/ui/ts-types.md @@ -56,6 +56,27 @@ | ColorStop | [Color, number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 | +## ResourceStr类型 + +| 名称 | 类型定义 | 描述 | +| -------- | -------- | -------- | +| ResourceStr | string \| Resource | 用于描述资源字符串的类型。 | + + +## ResourceColor类型 + +| 名称 | 类型定义 | 描述 | +| -------- | -------- | -------- | +| ResourceColor | Color \| number \| string \| Resource | 用于描述资源颜色类型。 | + + +## Font类型 + +| 名称 | 类型定义 | 描述 | +| -------- | -------- | -------- | +| Font | {
size?: Length;
weight?: FontWeight  \| number  \| string;
family?: string  \| Resource;
style?: FontStyle;
} | 设置文本样式:
| + + ## 示例 ```