tiny-vue/examples/sites/demos/mobile/app/checkboxgroup/min-max.vue

31 lines
652 B
Vue

<template>
<div class="checkbox-group-wrap">
<tiny-checkbox-group v-model="checkboxGroup" :min="1" :max="3">
<tiny-checkbox v-for="(city, index) in cities" :label="city" :key="index">{{ city }}</tiny-checkbox>
</tiny-checkbox-group>
</div>
</template>
<script lang="jsx">
import { Checkbox, CheckboxGroup } from '@opentiny/vue'
export default {
components: {
TinyCheckbox: Checkbox,
TinyCheckboxGroup: CheckboxGroup
},
data() {
return {
checkboxGroup: ['北京'],
cities: ['上海', '北京', '广州', '深圳']
}
}
}
</script>
<style scoped>
.checkbox-group-wrap {
padding: 20px;
}
</style>