Skip to content

KMultiSelect

示例

Multi Select

Vue

Selected: vue

Searchable

A multi-select dropdown that allows selecting multiple options from a list.

Props

NameTypeDefaultDescription
modelValuestring[][]Array of currently selected option values.
optionsArray<{ value: string; label: string }>— (required)Available options to choose from.
placeholderstring'Select...'Placeholder text when no options are selected.
searchablebooleanfalseWhether to show a search input for filtering options.
maxSelectionsnumberMaximum number of selectable items.

Emits

NameParametersDescription
update:modelValuestring[]Emitted when the selection changes.

Slots

NameDescription
This component does not provide slots.

Basic Usage

vue
<script setup>
import { ref } from 'vue'
import { KMultiSelect } from '@kK-2004/ui-component'

const selected = ref([])
const options = [
  { value: 'vue', label: 'Vue' },
  { value: 'react', label: 'React' },
  { value: 'svelte', label: 'Svelte' },
]
</script>

<template>
  <KMultiSelect v-model="selected" :options="options" searchable />
</template>