Skip to content

Commit 5d337d6

Browse files
committed
fix(CFormCheck): the checked attribute is not working when value is set
1 parent 6dd629d commit 5d337d6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

packages/coreui-vue/src/components/form/CFormCheck.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const CFormCheck = defineComponent({
189189
const formControl = () => {
190190
return h('input', {
191191
...attrs,
192-
...((props.modelValue || props.value) && { checked: isChecked.value }),
192+
...(props.modelValue && { checked: isChecked.value }),
193193
class: inputClassName,
194194
id: props.id,
195195
indeterminate: props.indeterminate,
@@ -236,26 +236,26 @@ const CFormCheck = defineComponent({
236236
props.button
237237
? [formControl(), (slots.label || props.label) && formLabel(), formValidation()]
238238
: props.label
239-
? props.hitArea
240-
? [
241-
h(
242-
CFormLabel,
239+
? props.hitArea
240+
? [
241+
h(
242+
CFormLabel,
243+
{
244+
customClassName: className,
245+
...(props.id && { for: props.id }),
246+
},
247+
[formControl(), props.label],
248+
),
249+
formValidation(),
250+
]
251+
: h(
252+
'div',
243253
{
244-
customClassName: className,
245-
...(props.id && { for: props.id }),
254+
class: className,
246255
},
247-
[formControl(), props.label],
248-
),
249-
formValidation(),
250-
]
251-
: h(
252-
'div',
253-
{
254-
class: className,
255-
},
256-
[formControl(), props.label && formLabel(), formValidation()],
257-
)
258-
: formControl()
256+
[formControl(), props.label && formLabel(), formValidation()],
257+
)
258+
: formControl()
259259
},
260260
})
261261

0 commit comments

Comments
 (0)