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
-
Problem Overview
In the current version of Vue, when using
customRef
to create custom refs, it’s required that theget
andset
functions have the same type. Otherwise, it results in a TypeScript error. However, I would likecustomRef
to support separate types for theget
andset
functions to meet specific requirements.Details
I am attempting to write the following code to fulfill a particular use case:
Expected Behavior
I expect
customRef
to support separate types for theget
andset
functions, enabling the successful compilation of the above code.BTW, TypeScript can do this:
Actual Behavior
Currently, TypeScript reports errors because the
get
andset
functions have incompatible types. Additionally, the use ofsuggestions
in 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