Skip to content

Combobox ​

Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码

预览 ​

Workspace

用法 ​

vue
<script setup lang="ts">
import { Combobox } from 'beui-vue'
import { ref } from 'vue'
const workspace = ref('studio')
const options = [
  { value: 'studio', label: 'Design studio', detail: '12 projects', group: 'Recent', color: '#d9a23c' },
  { value: 'product', label: 'Product team', detail: '8 projects', group: 'Recent', color: '#62aee0' },
  { value: 'playground', label: 'Playground', detail: '24 experiments', group: 'Workspaces', color: '#63a880' },
  { value: 'archive', label: 'Component archive', detail: '41 components', group: 'Workspaces', color: '#ce7490' },
]
</script>
<template><div class="workspace"><small>Workspace</small><Combobox v-model="workspace" :options="options" label="Search workspaces" placeholder="Search workspaces…" empty="No workspaces found." /></div></template>
<style scoped>.workspace { width: min(18rem,100%); } small { display: block; color: var(--beui-muted-foreground); margin-bottom: .5rem; }</style>

API ​

options 提供选项以及可选 group、detail、keywords。输入筛选后可用方向键和回车选择,v-model 同步选中值。

还原验收 ​

基于 beUI 的独立 Vue 移植,依 MIT 许可证分发。