Replies: 1 comment
-
|
Yes, it would be nice to have two generic arguments ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Overview
In the current version of Vue, when using
customRefto create custom refs, it’s required that thegetandsetfunctions have the same type. Otherwise, it results in a TypeScript error. However, I would likecustomRefto support separate types for thegetandsetfunctions to meet specific requirements.Details
I am attempting to write the following code to fulfill a particular use case:
Expected Behavior
I expect
customRefto support separate types for thegetandsetfunctions, enabling the successful compilation of the above code.BTW, TypeScript can do this:
Actual Behavior
Currently, TypeScript reports errors because the
getandsetfunctions have incompatible types. Additionally, the use ofsuggestionsin the template also requires type assertion, which is something I’d prefer to avoid.Additional Information
Vue: 3.3.4
TypeScript: 5.1.6
Beta Was this translation helpful? Give feedback.
All reactions