vue-phone-number-input icon indicating copy to clipboard operation
vue-phone-number-input copied to clipboard

(BUG) Can't use it without v-model

Open wug-ge opened this issue 4 years ago • 2 comments
trafficstars

I need the international number (with country code) always, the value emitted by v-model seems to only give the value of the phone number without a country code. (which can also be debated imho)

To get the international number, I'm listening for update events instead, so I'm not using the value in the v-model at all. I tried removing it, but then the input box doesn't work at all, is a v-model required?

If that's only a strange issue with my setup please tell me, it feels a bit ugly to have an unused variable only for an unused v-model.

Thanks in advance!

wug-ge avatar Nov 01 '21 09:11 wug-ge

Minimal reproduction Codepen

See that for the second phone-input, it's not editable.

GMartigny avatar Mar 11 '22 08:03 GMartigny

For anyone who would come here from Google.

It is impossible to type in anything, as everything typed in being removed immediately. The input clears itself.

The solution is to set any v-model in the component: <vue-phone-number-input v-model="anyDummyDataModel" />

AlexeyPlodenko avatar Jul 22 '22 11:07 AlexeyPlodenko