Files
oa/documentation/elements/forms/select/select-multiple-documentation.md
2025-05-24 01:49:48 +09:00

2.3 KiB

state
state
input

Multiple selection

The Vuero VSelect can have multiple attribute. Please refer to the code example for more details about usage.

<script setup lang="ts">

const input = ref<string[]>([])
</script>

<template>
  <VField>
    <VControl>
      <VSelect
        v-model="input"
        multiple
        size="8"
      >
        <VOptgroup label="Marvel">
          <VOption value="Spider-Man">
            Spider-Man
          </VOption>
          <VOption value="Professor X" disabled>
            Professor X
          </VOption>
          <VOption value="Deadpool">
            Deadpool
          </VOption>
        </VOptgroup>
        <VOptgroup label="DC">
          <VOption value="Batman">
            Batman
          </VOption>
          <VOption value="Superman">
            Superman
          </VOption>
          <VOption value="Green Lantern">
            Green Lantern
          </VOption>
        </VOptgroup>
        <VOptgroup label="Looney Tunes" disabled>
          <VOption value="Bugs Bunny">
            Bugs Bunny
          </VOption>
          <VOption value="Daffy Duck">
            Daffy Duck
          </VOption>
          <VOption value="Marvin the Martian">
            Marvin the Martian
          </VOption>
        </VOptgroup>
      </VSelect>
    </VControl>
  </VField>
</template>
Spider-Man Professor X Deadpool Batman Superman Green Lantern Bugs Bunny Daffy Duck Marvin the Martian

Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.