# import
>[success] import hy\_ui.hy\_form.hy_combobox
# extends
>[success] import hy\_ui.hy\_span.hy\_input;
# 構造函數
```
hy_combobox(Placeholder:String="請選擇",Color:String="default",Size:String="de",Icon:String="",startInit:Boolean=true)
```
```
pirvate var combobox=new hy_combobox("請選擇");
this.addChild(combobox);
```
# 舞臺命名
>[danger] name【變量名】$verify【驗證】$placeholder【占位符】$disabled【禁用】
```
title$required_phone$請輸入標題$true
```
# 屬性
## baseType 基本類型
>[info] String \[ get \] `combobox`
## isField 是否表單元素
>[info] Boolean \[ get \] `true`
> 提交表單的時候一般先判斷
## color 顏色樣式
>[info] String | Object \[ set \] `default`
| 默認 | 主要 | 成功 | 信息 | 警告 | 危險 | 灰色 | 藍色 | 黑色 | 錯誤 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| default | primary | success | info | warning | danger | gray | blue | black | error |
```
combobox.color="success"
```
## size 大小樣式
>[info] String | Object \[ set \] `de`
| | 迷你 | 小 | 默認 | 大 | 超大 |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 屬性 | xs | sm | de | lg | slg |
| 字體 | 12 | 12 | 14 | 18 | 30 |
| 高度 | 20 | 28 | 36 | 42 | 54 |
```
combobox.size="sm"
```
## width 寬度
>[info] Number \[ get | set \] `36*4`
> 如果不設置,通過size 自動變化
```
combobox.width=300
```
## height 高度
>[info] Number \[ get | set \] `36`
> 如果不設置,通過size 自動變化
```
combobox.height=100
```
## disabled 禁用
>[info] Boolean \[ get | set \] `false`
```
combobox.disabled=true//禁用
```
## align 中心對齊方式
>[info] String \[ get | set \] `top_left`
| 上下 | 左右 |
| :---: | :---: |
| top , center , bottom | left , center , right |
```
combobox.align="top_center"
```
## list 列表
>[info] Array \[ set \] `[]`
```
combobox.list=["選項1","選項2","選項3"]
```
```
combobox.list=[{title:"請選擇"value:""},{title:"選項1"value:1},{title:"選項2"value:2}]
```
## appendList 追加數據
>[info] Array \[ set \] `[]`
>[] 和list用法一樣
## value 值
>[info] Object \[ get | set \] `""`
> 和list 的value 保存一致
## embedFonts 字體嵌套
>[info] Boolean \[ set \] `false`
```
combobox.embedFonts=true
```
## error 錯誤提示
>[info] Boolean \[ set \] `false`
> 提交表單時候,如果有錯誤, 邊框顏色變紅
```
combobox.error=true
```
## placeholder 占位符
>[info] String \[ public \] `請輸入`
```
combobox.placeholder="請輸入電話"
```
## verify 驗證
>[info] String \[ public \] \`\`
| 必選 |
| :---: |
| required |
```
combobox.verify="required"//必選
```
## icon 圖標
>[info] String \[ set \] `""`
```
combobox.icon="search"
```
## showBorder 顯示邊框
>[info] Boolean \[ set \] `true`
```
combobox.showBorder=false
```
# 監聽
## change
>[info] 監聽切換
```
combobox.on("change",function(value,title,oThis))
```