Skip to content

Combobox-DEMO ​


属性 ​


属性类型必填默认值说明
modelValueobject否{}Combobox当前项绑定。
optionsarray否[]Combobox数据。
borderWidthnumber否1
placeholderstring否'Combobox'
borderColorstring否''
borderRadiusnumber否6
backgroundstring否''
choosenBackgroundstring否''
choosenSliderBackgroundstring否''
inputForegroundstring否''
inputBackgroundstring否''
titleForegroundstring否''
itemHeightnumber否40Combobox Item 高度。
dropDownIconstring否'ChevronDown'
dropDownIconForegroundstring否''
revealBorderColorboolean否false
revealBackgroundColorboolean否false
isBoxShadowboolean否false是否为 Combobox 输入框启用阴影样式。
disabledboolean否false
themestring否'global'主题样式。支持 global、light、dark、system 和 custom。
langstring否"global"参见组件的 lang 选项。

事件 ​


事件名参数说明
choose-itemvalue/objectCombobox choose item

插槽 ​


  1. Default

用户可自定义 Combobx Item 内容

vue
<slot :item="item">
    {{valueTrigger(item.type) !== 'divider' ? valueTrigger(item.text) : ''}}
</slot>

用户自定义样式时, 包含以下可选属性

  • item: 当前组数据
vue
<template v-slot:default="x">
  <i>{{x.item.text}}</i>
</template>

Data ​


  1. options
javascript
options = [{key: '', text: '', type: '', disabled: ''}]

//e.g.//

options: [
    { key: "fruitsHeader", text: "Fruits", type: "header" },
    { key: "apple", text: "Apple" },
    { key: "banana", text: "Banana" },
    { key: "orange", text: "Orange", disabled: true },
    { key: "grape", text: "Grape" },
    { key: "divider_1", text: "-", type: "divider" },
    { key: "vegetablesHeader", text: "Vegetables", type: "header" },
    { key: "broccoli", text: "Broccoli" },
    { key: "carrot", text: "Carrot" },
    { key: "lettuce", text: "Lettuce" }
]

特别地 0.1.62版本后支持采用函数式字段, 其中支持的字段包括text, disabled, type

MIT Licensed