Vue: Add a alias for v-model

Created on 11 Jun 2016  ·  6Comments  ·  Source: vuejs/vue

Please add a alias for v-model like @click or :bind

My suggestion: "m"

Example

<input type="text" m="user.name"/>

Most helpful comment

This issue was closed over three years ago. v-model is sufficient.

All 6 comments

Come on, it's not on the same level :smile:
You use events and bindings many more times that you use v-model.
That said, you can create your own directive v-m that addsv-model to an element before other directives

v-on and v-bind can use shorthands because they are almost always used with arguments. I don't think shorthands for non-argument usage makes sense.

I think this could be useful. To do something like $property to bind any property vue instance in the form of a model? So instead of v-model="name" one would simply do $name.

I'd be glad to work on this as a PR.

How about =


vs

Or I +1 use of @

So, no shorthand for v-model yet? How about $="name" ?

This issue was closed over three years ago. v-model is sufficient.

Was this page helpful?
0 / 5 - 0 ratings