International Telephone Input with Vue.js

International Telephone Input with Vue.js

International Telephone Input with Vue.International Telephone Input with Vue https://educationlink.github.io/vue-tel-input/ - EducationLink/vue-tel-input.

vue-tel-input

International Telephone Input with Vue. Useful Links

Table of Contents

Getting started

  • Install the plugin:

    npm install vue-tel-input
    
  • Add the plugin into your app:

        source-js
    import Vue from 'vue'
    import VueTelInput from 'vue-tel-input'
    
    Vue.use(VueTelInput)

    More info on installation

  • Use the vue-tel-input component:

        text-html-basic
    <template>
      <vue-tel-input v-model="phone"></vue-tel-input>
    <template>

Installation

npm

source-shell
npm install vue-tel-input

Install the plugin into Vue:

source-js
import Vue from 'vue'
import VueTelInput from 'vue-tel-input'

Vue.use(VueTelInput, [globalOptions = {}]) // Define default global options here (optional)

View all available options in Props.

Or use the component directly:

text-html-basic
<!-- your-component.vue-->
<template>
  <vue-tel-input v-model="value"></vue-tel-input>
</template>
<script>
import { VueTelInput } from 'vue-tel-input'

export default {
  components: {
    VueTelInput,
  },
};
</script>

Browser

Include vue-tel-input in the page.

text-html-basic
<script src="https://unpkg.com/vue-tel-input"></script>

If Vue is detected in the Page, the plugin is installed automatically.

Manually install the plugin into Vue:

source-js
Vue.use(VueTelInput)

Or use the component directly:

source-js
Vue.component('vue-tel-input', VueTelInput.VueTelInput)

Use as a custom field of vue-form-generator

Check out the setup in CodeSandbox.

  • Add a component using vue-form-generator's abstractField mixin

        text-html-basic
      <!-- tel-input.vue -->
      <template>
        <vue-tel-input v-model="value"></vue-tel-input>
      </template>
    
      <script>
      import { abstractField } from 'vue-form-generator';
    
      export default {
        name: 'TelephoneInput',
        mixins: [abstractField],
      };
      </script>
  • Register the new field as a global component

        source-js
     import Vue from 'vue';
     import TelInput from '<path>/tel-input.vue';
    
     Vue.component('field-tel-input', TelInput);
  • Now it can be used as tel-input in schema of vue-form-generator

        source-js
    var schema: {
      fields: [{
          type: "tel-input",
          label: "Awesome (tel input)",
          model: "telephone"
      }]
    };

Read more on vue-form-generator's instruction page

Usage

Props

Test all props on CodeSandbox.

Typescript Support

If you work with typescript you will need declaration requirements.

source-shell
npm install --save-dev @types/vue-tel-input

Download Details:

GitHub: https://github.com/EducationLink/vue-tel-input

Download Link: https://github.com/EducationLink/vue-tel-input/archive/master.zip

vuejs javascript vue-js

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

8 Popular Websites That Use The Vue.JS Framework

In this article, we are going to list out the most popular websites using Vue JS as their frontend framework. Vue JS is one of those elite progressive JavaScript frameworks that has huge demand in the web development industry. Many popular websites are developed using Vue in their frontend development because of its imperative features.

Top 10 VueJS Development Companies To Know In 2021-22

Find the list of Top 10 VueJS Development Companies to help you out in hiring reliable Vue.js developers for web & mobile app development.

Laravel 8 VUE JS Example | Laravel 8 VUE JS Tutorial For Beginners

<div class="gen-info-box"><b>Recommended:-</b><a href="https://www.tutsmake.com/laravel-8-vue-js-post-axios-request-tutorial/">Laravel 8 Vue JS Post Axios Request Tutorial</a></div> <div class="gen-info-box"><b>Recommended:-</b><a...

Hire Dedicated Vuejs Developers - Hire Vue.Js Development Company

Employ our best Vue.js Developers for your custom Vue JS app development. We provide end to end Vue development services & solutions to both small and large companies.

Vue ShortKey plugin for Vue.js

Vue-ShortKey - The ultimate shortcut plugin to improve the UX .Vue-ShortKey - plugin for VueJS 2.x accepts shortcuts globaly and in a single listener.