diff --git a/docs/pages/kcheckbox.vue b/docs/pages/kcheckbox.vue
index a64a3d1e8..1f75dfc4f 100644
--- a/docs/pages/kcheckbox.vue
+++ b/docs/pages/kcheckbox.vue
@@ -8,14 +8,12 @@
The checkbox is generally used to select one of two possible values in a form.
@@ -48,16 +46,19 @@
title="States"
anchor="#states"
>
- The checked state represents an affirmative value.
+
+ The v-model or checked checkbox state represents an affirmative
+ value.
+
Checkboxes can also have a "partially-checked" or "indeterminate" state used in cases where
the value is neither true nor false, such as when a subset of a topic is selected:
@@ -81,9 +82,8 @@
@@ -102,10 +102,7 @@
-
+
+
+
+ v-model supports array, boolean, number, string, and object.
+
+
+ Array
+
+
+
+ Each value will be added/removed from the selectedGroupIds array
+ based on each checkbox state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Boolean
+
+
+
+ If checked, isSelected will become true, otherwise
+ false. Note that here, value is not needed.
+
+
+
+
+ Number
+
+
+
+ If checked, selectedNumber will be set to value, otherwise
+ null.
+
+
+
+
+ String
+
+
+
+ If checked, selectedString will be set to value, otherwise
+ null.
+
+
+
+
+ Object
+
+
+
+ If checked, selectedObject will be set to value, otherwise
+ null.
+
+
+
+
+
+ As an alternative to v-model, the combination of :checked and
+ @changed can also be used to dynamically update selected choices.
+
+
+ Multiple checkboxes
+
+
+
+ This example achieves the same result as v-model's
+ array example.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Single checkbox
+
+
+
+ This example achieves the same result as v-model's
+ boolean example.
+
+
+
@@ -157,7 +290,6 @@
},
methods: {
handle3() {
- this.checked3 = !this.checked3;
this.indeterminate3 = false;
},
},
diff --git a/examples/KCheckbox/CheckedApiMultiple.vue b/examples/KCheckbox/CheckedApiMultiple.vue
new file mode 100644
index 000000000..ffdbaed5f
--- /dev/null
+++ b/examples/KCheckbox/CheckedApiMultiple.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/CheckedApiSingle.vue b/examples/KCheckbox/CheckedApiSingle.vue
new file mode 100644
index 000000000..7c7e544aa
--- /dev/null
+++ b/examples/KCheckbox/CheckedApiSingle.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/Deselected.vue b/examples/KCheckbox/Deselected.vue
index 1069d29d2..252753333 100644
--- a/examples/KCheckbox/Deselected.vue
+++ b/examples/KCheckbox/Deselected.vue
@@ -1,8 +1,21 @@
+
+
+
diff --git a/examples/KCheckbox/DeselectedDisabled.vue b/examples/KCheckbox/DeselectedDisabled.vue
index bfbff53b1..de6180bc3 100644
--- a/examples/KCheckbox/DeselectedDisabled.vue
+++ b/examples/KCheckbox/DeselectedDisabled.vue
@@ -1,9 +1,22 @@
+
+
+
diff --git a/examples/KCheckbox/Indeterminate.vue b/examples/KCheckbox/Indeterminate.vue
index bf902985f..ceb05babf 100644
--- a/examples/KCheckbox/Indeterminate.vue
+++ b/examples/KCheckbox/Indeterminate.vue
@@ -1,8 +1,22 @@
+
+
+
diff --git a/examples/KCheckbox/IndeterminateDisabled.vue b/examples/KCheckbox/IndeterminateDisabled.vue
index 0c100c823..2712f97b1 100644
--- a/examples/KCheckbox/IndeterminateDisabled.vue
+++ b/examples/KCheckbox/IndeterminateDisabled.vue
@@ -1,9 +1,23 @@
+
+
+
diff --git a/examples/KCheckbox/LabelInDefaultSlot.vue b/examples/KCheckbox/LabelInDefaultSlot.vue
index c516fcd1d..b045decff 100644
--- a/examples/KCheckbox/LabelInDefaultSlot.vue
+++ b/examples/KCheckbox/LabelInDefaultSlot.vue
@@ -1,7 +1,23 @@
-
+
Label from default slot
+
+
+
diff --git a/examples/KCheckbox/Selected.vue b/examples/KCheckbox/Selected.vue
index 13d9ce1da..0e6b0c37d 100644
--- a/examples/KCheckbox/Selected.vue
+++ b/examples/KCheckbox/Selected.vue
@@ -1,8 +1,21 @@
+
+
+
diff --git a/examples/KCheckbox/SelectedDisabled.vue b/examples/KCheckbox/SelectedDisabled.vue
index 7769b99b7..2fcb74c56 100644
--- a/examples/KCheckbox/SelectedDisabled.vue
+++ b/examples/KCheckbox/SelectedDisabled.vue
@@ -1,9 +1,22 @@
+
+
+
diff --git a/examples/KCheckbox/VModelArray.vue b/examples/KCheckbox/VModelArray.vue
new file mode 100644
index 000000000..165edf8cb
--- /dev/null
+++ b/examples/KCheckbox/VModelArray.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/VModelBoolean.vue b/examples/KCheckbox/VModelBoolean.vue
new file mode 100644
index 000000000..5b41501f5
--- /dev/null
+++ b/examples/KCheckbox/VModelBoolean.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/VModelNumber.vue b/examples/KCheckbox/VModelNumber.vue
new file mode 100644
index 000000000..96b6fb7bd
--- /dev/null
+++ b/examples/KCheckbox/VModelNumber.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/VModelObject.vue b/examples/KCheckbox/VModelObject.vue
new file mode 100644
index 000000000..9bf5a091d
--- /dev/null
+++ b/examples/KCheckbox/VModelObject.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/VModelString.vue b/examples/KCheckbox/VModelString.vue
new file mode 100644
index 000000000..1e460bf13
--- /dev/null
+++ b/examples/KCheckbox/VModelString.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/examples/KCheckbox/WithDescription.vue b/examples/KCheckbox/WithDescription.vue
index 79e7add35..1938a4785 100644
--- a/examples/KCheckbox/WithDescription.vue
+++ b/examples/KCheckbox/WithDescription.vue
@@ -1,8 +1,22 @@
+
+
+
diff --git a/examples/KCheckbox/WithoutLabel.vue b/examples/KCheckbox/WithoutLabel.vue
index da22f7d59..5f145a8e6 100644
--- a/examples/KCheckbox/WithoutLabel.vue
+++ b/examples/KCheckbox/WithoutLabel.vue
@@ -1,8 +1,22 @@
+
+
+
diff --git a/lib/KCheckbox/index.vue b/lib/KCheckbox/index.vue
index ebb035007..dd48db231 100644
--- a/lib/KCheckbox/index.vue
+++ b/lib/KCheckbox/index.vue
@@ -2,6 +2,7 @@
@@ -75,11 +80,12 @@