Skip to content

Commit

Permalink
refactor(vue/Field): update props usage for input components
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerAPfledderer committed Sep 13, 2024
1 parent cae700a commit dbd4dfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/vue/src/components/field/field-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface FieldInputProps
import { ark } from '../factory'
import { useFieldContext } from './use-field-context'
const props = defineProps<FieldInputProps>()
defineProps<FieldInputProps>()
const field = useFieldContext()
const emit = defineEmits(['update:modelValue'])
Expand All @@ -26,8 +26,8 @@ const emit = defineEmits(['update:modelValue'])
<template>
<ark.input
v-bind="field.getInputProps()"
:as-child="asChild"
:value="props.modelValue"
:as-child
:value="modelValue"
@input="(event) => emit('update:modelValue', (event.target as HTMLInputElement).value)"
>
<slot />
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/src/components/field/field-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface FieldSelectProps
import { ark } from '../factory'
import { useFieldContext } from './use-field-context'
const props = defineProps<FieldSelectProps & { modelValue?: string }>()
defineProps<FieldSelectProps & { modelValue?: string }>()
const field = useFieldContext()
const emit = defineEmits(['update:modelValue'])
Expand All @@ -26,9 +26,9 @@ const emit = defineEmits(['update:modelValue'])
<template>
<ark.select
v-bind="field.getSelectProps()"
:value="props.modelValue"
:value="modelValue"
@change="(event) => emit('update:modelValue', (event.target as HTMLSelectElement).value)"
:as-child="asChild"
:as-child
>
<slot />
</ark.select>
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/src/components/field/field-textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ export interface FieldTextareaProps
import { ark } from '../factory'
import { useFieldContext } from './use-field-context'
const props = defineProps<FieldTextareaProps>()
defineProps<FieldTextareaProps>()
const field = useFieldContext()
const emit = defineEmits(['update:modelValue'])
</script>

<template>
<ark.textarea
v-bind="field.getTextareaProps()"
:value="props.modelValue"
:value="modelValue"
@input="(event) => emit('update:modelValue', (event.target as HTMLTextAreaElement).value)"
:as-child="asChild"
:as-child
>
<slot />
</ark.textarea>
Expand Down

0 comments on commit dbd4dfb

Please sign in to comment.