mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 20:58:22 +08:00
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:
parent
1347fdf35a
commit
3f588b0406
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user