refactor(components): [el-checkbox] simplify the value (#4674)

Co-authored-by: iceman <dd>
This commit is contained in:
iceman 2021-12-10 18:13:35 +08:00 committed by GitHub
parent 35b1f24f8e
commit 70b754fe93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,12 +62,11 @@ const useModel = (props: IUseCheckboxProps) => {
const { emit } = getCurrentInstance()
const { isGroup, checkboxGroup } = useCheckboxGroup()
const isLimitExceeded = ref(false)
const store = computed(() =>
checkboxGroup ? checkboxGroup.modelValue?.value : props.modelValue
)
const model = computed({
get() {
return isGroup.value ? store.value : props.modelValue ?? selfModel.value
return isGroup.value
? checkboxGroup.modelValue?.value
: props.modelValue ?? selfModel.value
},
set(val: unknown) {