CheckButtonGroup
Demos
Size variants
Available values for the ui
prop: s
/ m
.
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="s"
: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>
<style lang="less" scoped>
section {
margin-bottom: 20px;
}
h4 {
margin-top: 0;
}
</style>
API
Props
Name | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ui | string= | - | Style variants.
| ||||||||||||
items | Array<Object> | [] | The datasource of items with the item type being
| ||||||||||||
value | Array | [] |
The | ||||||||||||
disabled | boolean= | false | Whether the check button group is disabled. | ||||||||||||
readonly | boolean= | false | Whether the check button group is read-only. | ||||||||||||
empty-value | * | - | The value to be selected when all selected values are deselected. Used when exclusive items are present. |
Slots
Name | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item | The label content of each button. Displays the value of the
Additionally, custom properties apart from the listed ones will also be passes into the scope object via |
Events
Name | Description |
---|---|
change |
Triggers when the selected item changed. The callback parameter list is |
Icons
Name | Description |
---|---|
check | The loading spinner. |