vue-the-mask icon indicating copy to clipboard operation
vue-the-mask copied to clipboard

How can I use v-on:change="onChange"?

Open ednilsonamaral opened this issue 5 years ago • 3 comments

I tried to use change in the ways below, but none worked.

<the-mask :mask="'#####-###'" id="input" class="form-control" v-model="signUpData.address.zipCode" name="zipCode" v-on:change.native="getAddress" />

<the-mask :mask="'#####-###'" id="input" class="form-control" v-model="signUpData.address.zipCode" name="zipCode" v-on:change.prevent="getAddress" />

<the-mask :mask="'#####-###'" id="input" class="form-control" v-model="signUpData.address.zipCode" name="zipCode" @change="getAddress()" />

Does anyone know how to solve?

Thank you! :)

ednilsonamaral avatar Dec 04 '19 17:12 ednilsonamaral

mmm...

When you typing or when lost the focus (blur)?

v-on:input="" is when you are typing. v-on:blur="" when lost focus.

change i think is for other type of event.

SergioFloresG avatar Dec 05 '19 18:12 SergioFloresG

Ok, i check v-on:change in not implemented. But if you put @change.native is work.

I think it would be good if @change is implemented natively. You don't always want to do something when you are typing.

SergioFloresG avatar Dec 05 '19 20:12 SergioFloresG

@change is not working. Is there any answer for why change event is useless on this component?

erhanfirat avatar Dec 24 '21 09:12 erhanfirat