LouisMazel / vue-phone-number-input

A phone number input made with Vue JS (format & valid phone number)

Home Page:https://louismazel.github.io/vue-phone-number-input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wug-ge opened this issue · comments

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!

Minimal reproduction Codepen

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

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" />