Can I pass Ref to modelValue to enable two-way binding? #17783
Unanswered
Maxim-Mazurok
asked this question in
Q&A
Replies: 2 comments 1 reply
-
That's weired. You could define a type-safed props interface? |
Beta Was this translation helpful? Give feedback.
1 reply
-
It isn't intentional but I guess it's because we pass the initial value of the prop to another ref here then assign to it
Is this actually type safe? I don't imagine a string prop accepting Ref. I did bring this up with the vue devs a couple years ago about adding v-model types for jsx but it never went anywhere as it would conflict with the way volar handles it. |
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.
-
We used to have this to get type-safe two-way binding:
And just discovered that passing a Ref also seems to work the same way:
Full component:
Would this be considered an expected behavior? I wouldn't expect Vuetify to attempt changing
modelValue
that I'm passing, I thought that it will only emit onUpdate events. However I can certainly see that tab index is updating.I'm not sure if it's a bug or a feature?...
Beta Was this translation helpful? Give feedback.
All reactions