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
I am attempting to migrate a Vue 2 app to Vue 3 and am mystified by the decision to remove binding.expression from the custom directive API. I couldn't find any explanation given for what seems like an arbitrary and unnecessary regression.
Without it, it is impossible to create a directive like v-model. To use the example in the docs of a v-focus directive, of course setting the focus from the value of a data property is trivial:
However, making this more useful by adding two-way binding that updates the data property on focus and blur events is now impossible. In Vue 2, it could be done using binding.expression as follows:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to migrate a Vue 2 app to Vue 3 and am mystified by the decision to remove
binding.expression
from the custom directive API. I couldn't find any explanation given for what seems like an arbitrary and unnecessary regression.Without it, it is impossible to create a directive like
v-model
. To use the example in the docs of av-focus
directive, of course setting the focus from the value of a data property is trivial:However, making this more useful by adding two-way binding that updates the data property on focus and blur events is now impossible. In Vue 2, it could be done using
binding.expression
as follows:Thanks.
Beta Was this translation helpful? Give feedback.
All reactions