fix(components): [checkbox] label is object in group (#9271)

* fix(components): [checkbox] label is object in group

* fix(components): [checkbox] abbreviated code
This commit is contained in:
Xc 2022-08-25 21:59:03 +08:00 committed by GitHub
parent 1347fdf35a
commit 3f588b0406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,12 @@
import { computed, getCurrentInstance, inject, nextTick, ref, watch } from 'vue'
import {
computed,
getCurrentInstance,
inject,
nextTick,
ref,
toRaw,
watch,
} from 'vue'
import { toTypeString } from '@vue/shared'
import { UPDATE_MODEL_EVENT } from '@element-plus/constants'
import {
@ -182,7 +190,7 @@ const useCheckboxStatus = (
if (toTypeString(value) === '[object Boolean]') {
return value
} else if (Array.isArray(value)) {
return value.includes(props.label)
return value.map(toRaw).includes(props.label)
} else if (value !== null && value !== undefined) {
return value === props.trueLabel
} else {