Files
oa/documentation/plugins/multiselect/multiselect-disabled-option-documentation.md
2025-05-24 01:49:48 +09:00

1.9 KiB

disabledOptions, disabledValue
disabledOptions disabledValue
value label
batman Batman
value label disabled
robin Robin true
value label
joker Joker
batman

Disabled Option

<Multiselect /> options can be disabled. Simply pass a disabled property in your options object.

<script setup lang="ts">
const disabledValue = ['batman']
const disabledOptions = [
  { value: 'batman', label: 'Batman' },
  { value: 'robin', label: 'Robin', disabled: true },
  { value: 'joker', label: 'Joker' },
]
</script>

<template>
  <VField v-slot="{ id }">
    <VControl>
      <Multiselect
        v-model="disabledValue"
        :attrs="{ id }"
        mode="multiple"
        :options="disabledOptions"
        placeholder="Select options"
      />
    </VControl>
  </VField>
</template>