Combobox 组合框
带搜索的下拉选择,从选项列表中筛选并选中。另有 `EditableCombobox` 允许输入列表外的值。
何时使用
- 需要可搜索、可自由输入的选择框时。
- 选项较多、需要筛选过滤时。
基础用法
导入
Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
modelValue | string | number | - | 选中值(v-model) |
options | ComboboxOption[] | [] | 选项:{ label, value } |
placeholder | string | 跟随语言 | 占位文字 |
emptyText | string | 跟随语言 | 无匹配提示 |
size | string | medium | 尺寸,支持 small / medium / large(触发按钮高度 32 / 36 / 44px) |
disabled | boolean | false | 禁用 |
size对Combobox与EditableCombobox同时生效;0.6.5 起combobox由components/ui迁至components/reui,@reglow/reui/ui/combobox旧路径继续可用,新主路径为@reglow/reui/reui/combobox。
国际化
placeholder、emptyText、搜索框占位等文案默认跟随全局语言(zh-CN / zh-TW / en-US),传 prop 可覆盖。
