@@ -20,6 +20,74 @@ Browser default checkboxes are replaced with the help of `<CFormCheck>`. Checkbo
2020<CFormCheck id="flexCheckChecked" label="Checked checkbox" checked />
2121```
2222
23+ ### vModel
24+
25+ Single checkbox, boolean value.
26+
27+ ::: demo
28+ <CFormCheck id =" flexCheckDefaultVModel " label =" Default checkbox " v-model =" checked " />
29+ <div >Checked: {{checked}}</div >
30+ :::
31+ ``` vue
32+ <template>
33+ <CFormCheck id="flexCheckDefaultVModel" label="Default checkbox" v-model="checked" />
34+ <div>Checked: {{checked}}</div>
35+ </template>
36+ <script>
37+ import { ref } from 'vue'
38+ export default {
39+ setup() {
40+ const checked = ref(true)
41+ return {
42+ checked
43+ }
44+ }
45+ }
46+ </script>
47+ ```
48+
49+ We can also bind multiple checkboxes to the same array.
50+
51+ ::: demo
52+ <CFormCheck id =" lucas " value =" Lucas " label =" Lucas " v-model =" checkedNames " />
53+ <CFormCheck id =" andrew " value =" Andrew " label =" Andrew " v-model =" checkedNames " />
54+ <CFormCheck id =" anna " value =" Anna " label =" Anna " v-model =" checkedNames " />
55+ <div >Checked names: {{checkedNames}}</div >
56+ :::
57+ ``` vue
58+ <template>
59+ <CFormCheck id="lucas" value="Lucas" label="Lucas" v-model="checkedNames"/>
60+ <CFormCheck id="andrew" value="Andrew" label="Andrew" v-model="checkedNames"/>
61+ <CFormCheck id="anna" value="Anna" label="Anna" v-model="checkedNames"/>
62+ <div>Checked names: {{checkedNames}}</div>
63+ </template>
64+ <script>
65+ import { ref } from 'vue'
66+ export default {
67+ setup() {
68+ const checkedNames = ref(['Andrew'])
69+ return {
70+ checkedNames
71+ }
72+ }
73+ }
74+ </script>
75+ ```
76+
77+ <script >
78+ import { ref } from ' vue'
79+ export default {
80+ setup () {
81+ const checked = ref (true )
82+ const checkedNames = ref ([' Andrew' ])
83+ return {
84+ checked,
85+ checkedNames
86+ }
87+ }
88+ }
89+ </script >
90+
2391## Indeterminate
2492
2593Checkboxes can utilize the ` :indeterminate ` pseudo-class when manually set via ` indeterminate ` property.
@@ -32,7 +100,7 @@ Checkboxes can utilize the `:indeterminate` pseudo-class when manually set via `
32100<CFormCheck id="flexCheckIndeterminate" label="Indeterminate checkbox" indeterminate />
33101```
34102
35- ### Disabled
103+ ## Disabled
36104
37105Add the ` disabled ` attribute and the associated ` <label> ` s are automatically styled to match with a lighter color to help indicate the input's state.
38106
0 commit comments