diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/select.png b/zh-cn/application-dev/reference/arkui-ts/figures/select.png new file mode 100644 index 0000000000000000000000000000000000000000..18785385d1126fb1824ee618521a9b95dd621197 Binary files /dev/null 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 new file mode 100644 index 0000000000000000000000000000000000000000..cb81abdaad39147e5fb79f1dd62d6afd74351d15 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md @@ -0,0 +1,229 @@ +# Slelect + +>![](../../public_sys-resources/icon-note.gif) **说明:** +>该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + +提供下拉选择按钮,可以让用户在多个选项之间选择。 + +## 权限列表 + +无 + +## 子组件 + +无 + +## 接口 + +Select(options: Array<SelectOption>) + +- `SelectOption`参数 + +
参数名 + |
+ 参数类型 + |
+ 必填 + |
+ 默认值 + |
+ 参数描述 + |
+
---|---|---|---|---|
value + |
+ string | Resource + |
+ 是 + |
+ - + |
+ 下拉选项内容。 + |
+
icon + |
+ string | Resource + |
+ 否 + |
+ - + |
+ 下拉选项图片。 + |
+
名称 + |
+参数类型 + |
+默认值 + |
+描述 + |
+
---|---|---|---|
selected + |
+number + |
+- + |
+设置下拉菜单选择项序号,从0开始。 + |
+
value + |
+string + |
+- + |
+设置下拉按钮本身的文本显示。 + |
+
font + |
+{ +size?: Length, +weight?: number | FontWeight, +family?: string, +style?: FontStyle +} + |
+- + |
+设置select文本样式: +
|
+
fontColor + |
+Color | Resource + |
+- + |
+设置下拉按钮本身的文本颜色。 + |
+
selectedOptionBgColor + |
+Color | Resource + |
+- + |
+设置下拉菜单选中项的背景色。 + |
+
selectedOptionFont + |
+{ +size?: Length, +weight?: number | FontWeight, +family?: string, +style?: FontStyle +} + |
+- + |
+设置已选中option的文本样式: +
|
+
selectedOptionFontColor + |
+Color | Resource + |
+- + |
+设置下拉菜单选中项的文本颜色。 + |
+
optionBgColor + |
+Color | Resource + |
+- + |
+设置下拉菜单项的背景色。 + |
+
optionFont + |
+{ +size?: Length, +weight?: number | FontWeight, +family?: string, +style?: FontStyle +} + |
+- + |
+设置option文本样式: +
|
+
optionFontColor + |
+Color | Resource + |
+- + |
+设置下拉菜单项的文本颜色。 + |
+
名称 + |
+功能描述 + |
+|
---|---|---|
onSelected(callback: (index: number, value?:string) => void) + |
+下拉菜单选中某一项的回调。 +index:选中项的索引。 +value:选中项的值。 + |
+