vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.99k stars 33.69k forks source link

Request: add v-model.lazy for components #6914

Open pdanpdan opened 7 years ago

pdanpdan commented 7 years ago

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'
}
Mikilll94 commented 5 years ago

Is it going to be done?

iec989 commented 5 years ago

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!

Mikilll94 commented 5 years ago

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"

wc-matteo commented 5 years ago

I would love to have it as well!

mrcnk commented 5 years ago

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

Tantawi commented 5 years ago

Please add this!

danielbonifacio commented 4 years ago

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

sushi2all commented 4 years ago

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!!!

ap-arto commented 4 years ago

Please, add this asap :+1:

mes01 commented 4 years ago

Pleeeeeeeeeeease

Sjoerd82 commented 4 years ago

I have the same need. Workaround: https://stackoverflow.com/questions/56197736/how-to-avoid-v-text-field-to-emit-input-events

jjsty1e commented 2 years ago

image

SergeBayet commented 2 years ago

I had the same issue. Here's my workaround : `<div class=" el-input el-input--small el-input-group el-input-group--append "

<input size="small" class="el-inputinner" type="text" @blur="checkNameRecord(index)" autocomplete="off" v-model.lazy="record.name" /> <div class="el-input-groupappend"

{{ "." + soa.name + "." }}

`

Hope this help