Vue: Request: add v-model.lazy for components

Created on 25 Oct 2017  ·  11Comments  ·  Source: vuejs/vue

What problem does this feature solve?

v-model for components already supports .trim and .number.
Lazy modifier support for components would make it more uniform across the platform.

What does the proposed API look like?

The only change (backwards compatible) would be to add a new property to model definition:

model: {
  prop: 'value',
  event: 'input',
  eventLazy: 'change'
}
feature request has PR

Most helpful comment

yeah, exactly. I have an app made with Vuetify and on larger forms instead of using v-model I am typing
:value="sth" @change="($event) => sth = $event.target.value"

It would be nicer to type just
v-model.lazy = "sth"

All 11 comments

Is it going to be done?

I think a bunch of us are desperately waiting for this; mid-size forms get very slow as soon as you implement some basic VUE logic around the components, we really need this!

yeah, exactly. I have an app made with Vuetify and on larger forms instead of using v-model I am typing
:value="sth" @change="($event) => sth = $event.target.value"

It would be nicer to type just
v-model.lazy = "sth"

I would love to have it as well!

Also custom rules for Vuelidate need sometimes v-model.lazy, so it'd be useful not to introduce workarounds for it 🙌

Please add this!

Waiting for it! Would be a great enhance on productivity 😄

This would keep components much cleaner especially when binding to vuex data. Being able to use the .lazy modifier would allow me to keep both get and set functions in the computed properties rather than having to get the data in computed and commit the mutation with a method to be called @change. Please add!!!

Please, add this asap :+1:

Pleeeeeeeeeeease

Was this page helpful?
0 / 5 - 0 ratings