From 1582a8b1c692737fb0a7f9fa68cfee5671634a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 15 Sep 2021 16:42:07 +0800 Subject: [PATCH] Checkbox value support null --- src/components/checkbox/checkbox-group.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/checkbox/checkbox-group.vue b/src/components/checkbox/checkbox-group.vue index f010d587..035db672 100644 --- a/src/components/checkbox/checkbox-group.vue +++ b/src/components/checkbox/checkbox-group.vue @@ -30,8 +30,8 @@ }, data () { return { - currentValue: this.value, - childrens: [] + currentValue: this.value || [], + children: [] }; }, computed: { @@ -49,10 +49,10 @@ }, methods: { updateModel (update) { - this.childrens = findComponentsDownward(this, 'Checkbox'); - if (this.childrens) { - const { value } = this; - this.childrens.forEach(child => { + this.children = findComponentsDownward(this, 'Checkbox'); + if (this.children) { + const value = this.value || []; + this.children.forEach(child => { child.model = value; if (update) {