mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-01 10:47:57 +08:00
refactor(components): [el-checkbox] simplify the value (#4674)
Co-authored-by: iceman <dd>
This commit is contained in:
parent
35b1f24f8e
commit
70b754fe93
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user