-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide proper types #731
Comments
Found this issue looking at https://ui.nuxt.com/forms/form#backend-validation I would love to be able to d something like const form = ref<UForm|undefined>(undefined) |
import type { Form } from '@nuxt/ui/dist/runtime/types/form'
const form = ref<Form<any>>() |
My point is that the type exists, but is not correct.
The types don't match the actual implementation. |
I stumbled upon this thread while searching how to import types and getting errors with the explicit import mentioned above:
I wanted to mention that the (new?) way is: import type { Form } from '#ui/types' |
@romhml Do you think all of these are fixed in |
I just found one issue 🤨: <UInput @input="onInput" /> works, but causes a type error
But still, v3 is a huge improvement and really makes me consider |
Found another one: <UInput type="submit" form="ref" /> works, but fails type check:
|
I could not reproduce any type issues mentioned except for the Form component using the |
@some-user123 Could you summarize what exactly doesn't work? I couldn't reproduce the last two examples you sent. I'd like to close this if everything's fine 😊 |
I think, this should be a minimal reproduction: https://github.com/some-user123/nuxt-ui-issue731. If you run
If you disable Nor do you get errors if you use these properties wrongly, e.g. <UInput @input="123">Hello</UInput>
<UButton type="submit" :form="() => console.log('foo')" /> Does this help? |
So this is related to |
No, these are separate issues. #2562 is that already the pure installation of @nuxt/ui (without using any component of it) causes type errors when This issue is that @nuxt/ui components are not properly typed. More specifically some properties are missing, e.g.
|
There are thousands of possible props on the It's the same about events, what do you need the |
Both If I already have full type support on In PrimeVue (as an example), I not only get the types right, but also the full description: |
Description
Components are not properly typed:
form
property on<UInput>
works, but is not typedid
property on<UForm>
works, but is not typedsubmit
method onForm<...>
works, but is not typedautocomplete
property on<UInput>
works, but is not typedCf: #668 #634
Additional context
No response
The text was updated successfully, but these errors were encountered: