docs_vue2/one/docs/demo/check-button-group/exclusive.vue
2020-09-22 11:06:13 +08:00

63 lines
973 B
Vue

<template>
<article>
<section>
<h4>Select size</h4>
<veui-check-button-group
v-model="selected"
:items="licenses"
empty-value="any"
/>
<p>Checked: {{ readable }}</p>
</section>
</article>
</template>
<script>
import { CheckButtonGroup } from 'veui'
export default {
components: {
'veui-check-button-group': CheckButtonGroup
},
data () {
return {
selected: ['any'],
licenses: [
{
label: 'Any',
value: 'any',
exclusive: true
},
{
label: 'Small',
value: 'sm'
},
{
label: 'Medium',
value: 'md'
},
{
label: 'Large',
value: 'lg'
}
]
}
},
computed: {
readable () {
return (this.selected || []).join(', ') || '-'
}
}
}
</script>
<style lang="less" scoped docs>
section {
margin-bottom: 20px;
}
h4 {
margin-top: 0;
}
</style>