Checkbox value support null

This commit is contained in:
梁灏 2021-09-15 16:42:07 +08:00
parent 7a1b1cc711
commit 1582a8b1c6

View file

@ -30,8 +30,8 @@
}, },
data () { data () {
return { return {
currentValue: this.value, currentValue: this.value || [],
childrens: [] children: []
}; };
}, },
computed: { computed: {
@ -49,10 +49,10 @@
}, },
methods: { methods: {
updateModel (update) { updateModel (update) {
this.childrens = findComponentsDownward(this, 'Checkbox'); this.children = findComponentsDownward(this, 'Checkbox');
if (this.childrens) { if (this.children) {
const { value } = this; const value = this.value || [];
this.childrens.forEach(child => { this.children.forEach(child => {
child.model = value; child.model = value;
if (update) { if (update) {