Giter Site home page Giter Site logo

Comments (8)

evansbusobozi avatar evansbusobozi commented on May 18, 2024 2

Thanks @nperegrine , Your solution worked for me.

from vue-phone-number-input.

nperegrine avatar nperegrine commented on May 18, 2024 2

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.

LouisMazel avatar LouisMazel commented on May 18, 2024

Hi,

Can you show me your code ?

Thanks

from vue-phone-number-input.

evansbusobozi avatar evansbusobozi commented on May 18, 2024

from vue-phone-number-input.

nperegrine avatar nperegrine commented on May 18, 2024

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.

evansbusobozi avatar evansbusobozi commented on May 18, 2024

from vue-phone-number-input.

evansbusobozi avatar evansbusobozi commented on May 18, 2024

from vue-phone-number-input.

evansbusobozi avatar evansbusobozi commented on May 18, 2024

from vue-phone-number-input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.