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 () {
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) {