ant-design-vue/components/checkbox/demo/layout.md

33 lines
818 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<cn>
#### 布局
Checkbox.Group内嵌Checkbox并与Grid组件一起使用可以实现灵活的布局
</cn>
<us>
#### Use with grid
We can use Checkbox and Grid Checkbox.group, to implement complex layout
</us>
```html
<template>
<a-checkbox-group @change="onChange">
<a-row>
<a-col :span="8"><a-checkbox value="A">A</a-checkbox></a-col>
<a-col :span="8"><a-checkbox value="B">B</a-checkbox></a-col>
<a-col :span="8"><a-checkbox value="C">C</a-checkbox></a-col>
<a-col :span="8"><a-checkbox value="D">D</a-checkbox></a-col>
<a-col :span="8"><a-checkbox value="E">E</a-checkbox></a-col>
</a-row>
</a-checkbox-group>
</template>
<script>
export default {
methods: {
onChange (checkedValues) {
console.log('checked = ', checkedValues)
},
},
}
</script>
```