CheckButtonGroup

Demos

Size variants

Available size variant for the ui prop: alt/large/small/tiny/micro/square.

Normal size

Checked: -

Small size

Checked: -

<template>
<article>
  <section>
    <h4>Normal size</h4>
    <veui-check-button-group
      v-model="selected"
      :items="licenses"
    />
    <p>Checked: {{ readable }}</p>
  </section>
  <section>
    <h4>Small size</h4>
    <veui-check-button-group
      v-model="selected"
      ui="small"
      :items="licenses"
    />
    <p>Checked: {{ readable }}</p>
  </section>
</article>
</template>

<script>
import { CheckButtonGroup } from 'veui'

export default {
  components: {
    'veui-check-button-group': CheckButtonGroup
  },
  data () {
    return {
      selected: null,
      licenses: [
        {
          label: 'MIT License',
          value: 'mit'
        },
        {
          label: 'BSD License',
          value: 'bsd'
        },
        {
          label: 'Apache License 2.0',
          value: 'apache2'
        }
      ]
    }
  },
  computed: {
    readable () {
      return (this.selected || []).join(', ') || '-'
    }
  }
}
</script>

API

Props

NameTypeDefaultDescription
uistring-

Style variants.

ValueDescription
altAlternative style.
largeLarge size.
smallSmall size.
tinyTiny size.
microMicro size.
squareSquare button.
itemsArray<Object>[]

The datasource of items with the item type being {label, value, disabled, ...}.

NameTypeDescription
labelstringThe descriptive label of the item.
value*The value of the item.
disabledboolean=Whether the item is disabled.
valueArray[]

v-model

The values of the selected items.

disabledbooleanfalseWhether the check button group is disabled.
readonlybooleanfalseWhether the check button group is read-only.

Slots

NameDescription
default

The label content of each button. Displays the value of the label prop by default.

NameTypeDescription
labelstringThe descriptive label of the item.
value*The value of the item.
indexnumberThe index of the item within items.
disabledboolean=Whether the item is disabled.

Additionally, custom properties apart from the listed ones will also be passes into the scope object via v-bind.

Events

NameDescription
change

v-model

Triggers when the selected item changed. The callback parameter list is (value: Array) and value is the value array of the selected items.