This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0
old
宇天 2019-09-30 18:36:49 +08:00
parent 8ef894f899
commit b85633a5b3
1 changed files with 2 additions and 1 deletions

View File

@ -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)
} }
} }