Skip to content

Commit

Permalink
fix(vue/number-input-field): remove unneccessary slots (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerAPfledderer committed Apr 27, 2023
1 parent aac6abe commit 80aa3c4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/vue/src/number-input/number-input-field.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { computed, defineComponent } from 'vue'
import { ark, type HTMLArkProps } from '../factory'
import { getValidChildren, type ComponentWithProps } from '../utils'
import type { ComponentWithProps } from '../utils'
import { useNumberInputContext } from './number-input-context'

export type NumberInputFieldProps = HTMLArkProps<'input'>

export const NumberInputField: ComponentWithProps<NumberInputFieldProps> = defineComponent({
name: 'NumberInputField',
setup(_, { slots, attrs }) {
setup(_, { attrs }) {
const api = useNumberInputContext()

const inputProps = computed(() => ({
...api.value.inputProps,
modelValue: api.value.value || '',
}))

return () => (
<ark.input {...inputProps.value} {...attrs}>
{() => getValidChildren(slots)}
</ark.input>
)
return () => <ark.input {...inputProps.value} {...attrs} />
},
})

0 comments on commit 80aa3c4

Please sign in to comment.