-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Support TS annotation on v-model #4655
Comments
On the Volar side it seems its bundled compiler hasn't updated to incorporate d23fde3 yet. /cc @johnsoncodehk |
It's not just a volar issue. I see a compilation error from vite and on the browser as well. |
I know. Turns out the TS transpiler used in SFC playground (sucrase) is able to parse invalid TS syntax generated by the compiler... but |
Essentially:
Thanks for looking into this 👍 |
New issue repro of issue #4640. It was closed with fix that appears to address a different issue. Apologies for reposting.
What problem does this feature solve?
An object with attributes of union type throws ts2322 in Volar when supplied to v-model for textarea, input (and others), when the attribute is specified in
v-model
. Type annotation would solve, and does do so withv-bind
, but doesn't work withv-model
. Ergo the only current workaround is to use a v-bind/@change combo where TS annotations can be used.Example usecase:
Template:
where arr is a MyType[]
More info: vuejs/language-tools#512
The text was updated successfully, but these errors were encountered: