You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directive<T> is generic in the type of target element.
It would be nice to have a second generic value (can default to any) for the binding.value type.
So that this can be written:
interfaceInterval{from: number;to: number;}constdir: Directive<Element,Interval>=(el,{value: { from, to }})=>{// from, to are number}
Without this, you have to cast binding.value explicitely inside the function body.
Hopefully this could be used in the future by Vetur to validate proper directive usage in templates.
What does the proposed API look like?
Modify to Directive<TElement = any, TValue = any>
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
Directive<T>
is generic in the type of target element.It would be nice to have a second generic value (can default to any) for the
binding.value
type.So that this can be written:
Without this, you have to cast
binding.value
explicitely inside the function body.Hopefully this could be used in the future by Vetur to validate proper directive usage in templates.
What does the proposed API look like?
Modify to
Directive<TElement = any, TValue = any>
The text was updated successfully, but these errors were encountered: