Files
element-plus/docs/examples/checkbox/button-style.vue
sea ade87f6729 docs(examples): standardize unified code format and fix some type (#16370)
* docs: standardize unified example code format and fix some example type

* docs:  update some example type

* Update docs/examples/descriptions/sizes.vue

Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>

* docs: update example-page-header

* docs: update example-page-header

---------

Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
2024-04-15 16:29:21 +08:00

51 lines
1.4 KiB
Vue

<template>
<div>
<el-checkbox-group v-model="checkboxGroup1" size="large">
<el-checkbox-button v-for="city in cities" :key="city" :value="city">
{{ city }}
</el-checkbox-button>
</el-checkbox-group>
</div>
<div class="demo-button-style">
<el-checkbox-group v-model="checkboxGroup2">
<el-checkbox-button v-for="city in cities" :key="city" :value="city">
{{ city }}
</el-checkbox-button>
</el-checkbox-group>
</div>
<div class="demo-button-style">
<el-checkbox-group v-model="checkboxGroup3" size="small">
<el-checkbox-button
v-for="city in cities"
:key="city"
:value="city"
:disabled="city === 'Beijing'"
>
{{ city }}
</el-checkbox-button>
</el-checkbox-group>
</div>
<div class="demo-button-style">
<el-checkbox-group v-model="checkboxGroup4" size="small" disabled>
<el-checkbox-button v-for="city in cities" :key="city" :value="city">
{{ city }}
</el-checkbox-button>
</el-checkbox-group>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const checkboxGroup1 = ref(['Shanghai'])
const checkboxGroup2 = ref(['Shanghai'])
const checkboxGroup3 = ref(['Shanghai'])
const checkboxGroup4 = ref(['Shanghai'])
const cities = ['Shanghai', 'Beijing', 'Guangzhou', 'Shenzhen']
</script>
<style scoped>
.demo-button-style {
margin-top: 24px;
}
</style>