Lacking TS support #3392
Unanswered
J-Michalek
asked this question in
PrimeVue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I started using PrimeVue inside of a TS project and since most of the components allow
any
as prop type I find the type control lacking.To improve this I decided to create wrapper component above the PrimeVue components which would provide a bridge where I would create all the types using generics or just typing it to a value that I expect it to be, but I am unable to do that with some components because they use very complicated types that the Vue compiler cannot handle.
Example
I will use the Button component as an example. The reason for me to do this is to easily extend the button with anything I need i.e. tooltips while still providing the same interface as the original Button component.
The example won't work because the
ButtonProps
interface extendsButtonHTMLAttributes
and the Vue compiler cannot handle that, also it seems wrong to me to use theButtonHTMLAttributes
interface because the button might not event end up being abutton
element when using theas
prop.I have some ideas to improve on this, but I decided that I would first create a discussion around it as to not waste my time with changes that might not event be considered.
Beta Was this translation helpful? Give feedback.
All reactions