Comments (8)
Thanks @nperegrine , Your solution worked for me.
from vue-phone-number-input.
Hi @Evanzsnr
If I understand what you're asking properly, here's how I got the data as displayed in the demo:
I used the @update
event to call a method updatePhoneNumber
and used the emitted event to get the data I wanted.
<vue-phone-number-input
v-model="phone"
:required="true"
default-country-code="CM"
@update="updatePhoneNumber"
/>
Below's my @updatePhoneNumber method I used to get the data from the emitted event:
/**
* Update phone number
*/
updatePhoneNumber(data) {
this.formatted_number = data.formattedNumber
this.national_number = data.nationalNumber
}
You can use the data object to get whatever prop you desired as shown in the demo.
Hope this helps 😀
from vue-phone-number-input.
Hi,
Can you show me your code ?
Thanks
from vue-phone-number-input.
from vue-phone-number-input.
Hey, @Evanzsnr Ran into this same issue.
Not sure exactly why, but when I changed the component name inside my vue.js files from:
<VuePhoneNumberInput />
to:
<vue-phone-number-input />
it works, hope this might help :)
from vue-phone-number-input.
from vue-phone-number-input.
from vue-phone-number-input.
from vue-phone-number-input.
Related Issues (20)
- When will you have a vue3 version? HOT 1
- Inputs RTL direction.
- (FEATURE REQUEST) Keyboard accessibility: Add @enter method when the user clicks on enter to submit phone number
- How to force validation (even if the user don't focus the field) ? HOT 1
- Cannot be used with Vue3? HOT 1
- (BUG) zoom-in Safari HOT 1
- (FEATURE REQUEST) - Quick Question HOT 1
- (BUG) Wrong invalid Phone Number
- (FEATURE REQUEST) Remove label
- (FEATURE REQUEST) Use class instead of inline style HOT 1
- (BUG)
- (FEATURE REQUEST) - more control over the input display number format
- 为什么**国旗不是**国旗,请尽快修正(BUG) HOT 4
- (BUG) accessibility issue, add a for on the <label> in countrySelector
- I'd like v-model to always use the nationalNumber key
- No flag images
- (FEATURE REQUEST) country code should be searchable
- Typescript support HOT 1
- (BUG) HOT 3
- Using it on mobile device HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-phone-number-input.