diff --git a/package.json b/package.json index e994a57..b656fae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "axp-ui", "descriiption": "My helper ui lib", - "version": "1.5.17", + "version": "1.5.18", "homepage": "https://antoxahub.ru/antoxa/axp-ui", "repository": { "type": "git", diff --git a/src/components/Field.vue b/src/components/Field.vue index d2056ca..82cf9c0 100644 --- a/src/components/Field.vue +++ b/src/components/Field.vue @@ -6,6 +6,7 @@ const props = defineProps<{ error?: string readonly?: boolean disabled?: boolean + checked?: boolean tag?: 'input' | 'textarea' | 'select' }>() @@ -58,6 +59,7 @@ const inputHandler = (val: any) => { :value="props.modelValue" :reatonly="props.readonly" :disabled="props.disabled" + :checked="checked" @input="inputHandler" class="input" /> diff --git a/src/components/FieldCheckbox.vue b/src/components/FieldCheckbox.vue index 98d3ed4..a306d57 100644 --- a/src/components/FieldCheckbox.vue +++ b/src/components/FieldCheckbox.vue @@ -11,16 +11,17 @@ const props = defineProps<{ const emit = defineEmits<{ (e: 'update:modelValue', v?: boolean): void }>() // Value. -const valueStr = computed({ - get: () => { - if (props.modelValue) return 'on' - }, - set: val => { - if (val !== undefined) emit('update:modelValue', !props.modelValue) - } -}) +const value = computed(() => props.modelValue) + +// Handlers. +const updateHandler = () => emit('update:modelValue', !props.modelValue)