vue-tel-input
International Telephone Input with Vue.
Checkout Demo at Codesandbox.
Installation
Usage
-
Import default CSS
to your project:
import 'vue-tel-input/dist/vue-tel-input.css';
-
Install as a global component:
import Vue from 'vue'
import VueTelInput from 'vue-tel-input'
Vue.use(VueTelInput)
-
In your component:
<template>
...
<vue-tel-input v-model="phone"
@onInput="onInput">
</vue-tel-input>
...
<template>
<script>
export default {
data() {
return {
phone: '',
};
},
methods: {
onInput({ number, isValid, country }) {
console.log(number, isValid, country);
},
},
}
</script>
Highlights & Credits
Demo Usage
$ yarn/npm install
$ yarn/npm dev
$ yarn/npm demo:open
$ yarn/npm dist:demo
$ yarn/npm dist
made with ❤ by Steven.