update
parent
8ef894f899
commit
b85633a5b3
|
@ -165,11 +165,12 @@ export default class Checkbox {
|
||||||
}
|
}
|
||||||
|
|
||||||
set value(val) {
|
set value(val) {
|
||||||
|
log(val, this, this.props.label)
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
this.props.value = val
|
this.props.value = val
|
||||||
this.checked = this.props.value.includes(this.props.label)
|
this.checked = this.props.value.includes(this.props.label)
|
||||||
} else {
|
} else {
|
||||||
throw TypeError(':duplex指令需要传入一个数组, 当前为: ' + typeof val)
|
console.error('checkbox组件的value必须是数组, 当前为: ' + typeof val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue