修复CheckBox bug
parent
bdc6b08234
commit
90357ae386
|
@ -69,17 +69,25 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
checked.splice(index, 1)
|
checked.splice(index, 1)
|
||||||
}
|
}
|
||||||
} else if (typeof this.checked == 'boolean') {
|
|
||||||
let bool = this.bool
|
|
||||||
if (this.indeterminate) {
|
|
||||||
bool = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.bool = bool
|
|
||||||
})
|
|
||||||
}
|
|
||||||
checked = bool
|
|
||||||
} else {
|
} else {
|
||||||
checked = this.bool ? this.value : ''
|
let bool = this.bool
|
||||||
|
switch (typeof this.checked) {
|
||||||
|
case 'boolean':
|
||||||
|
if (this.indeterminate) {
|
||||||
|
bool = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.bool = bool
|
||||||
|
})
|
||||||
|
}
|
||||||
|
checked = bool
|
||||||
|
break
|
||||||
|
case 'number':
|
||||||
|
checked = this.value
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
checked = bool ? this.value : ''
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$emit('input', checked)
|
this.$emit('input', checked)
|
||||||
this.$emit('change', checked)
|
this.$emit('change', checked)
|
||||||
|
|
Loading…
Reference in New Issue