mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 20:57:57 +01:00
fix(Checkbox): label interaction without FormGroup (#1427)
This commit is contained in:
@@ -39,6 +39,7 @@ import type { Strategy } from '../../types'
|
|||||||
import appConfig from '#build/app.config'
|
import appConfig from '#build/app.config'
|
||||||
import { checkbox } from '#ui/ui.config'
|
import { checkbox } from '#ui/ui.config'
|
||||||
import colors from '#ui-colors'
|
import colors from '#ui-colors'
|
||||||
|
import { useId } from '#app'
|
||||||
|
|
||||||
const config = mergeConfig<typeof checkbox>(appConfig.ui.strategy, appConfig.ui.checkbox, checkbox)
|
const config = mergeConfig<typeof checkbox>(appConfig.ui.strategy, appConfig.ui.checkbox, checkbox)
|
||||||
|
|
||||||
@@ -105,7 +106,8 @@ export default defineComponent({
|
|||||||
setup (props, { emit }) {
|
setup (props, { emit }) {
|
||||||
const { ui, attrs } = useUI('checkbox', toRef(props, 'ui'), config, toRef(props, 'class'))
|
const { ui, attrs } = useUI('checkbox', toRef(props, 'ui'), config, toRef(props, 'class'))
|
||||||
|
|
||||||
const { emitFormChange, color, name, inputId } = useFormGroup(props)
|
const { emitFormChange, color, name, inputId: _inputId } = useFormGroup(props)
|
||||||
|
const inputId = _inputId.value ?? useId()
|
||||||
|
|
||||||
const toggle = computed({
|
const toggle = computed({
|
||||||
get () {
|
get () {
|
||||||
|
|||||||
Reference in New Issue
Block a user