
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
vue-tel-input
Advanced tools
International Telephone Input with Vue.
Checkout Demo at Codesandbox.
yarn add vue-tel-input
npm i --save vue-tel-input
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: {
/**
* @param {string} number
* the phone number inputted by user, will be formatted along with country code
* // Ex: inputted: (AU) 0432 432 432
* // number = '+61432421546'
*
* @param {Boolean} isValid
* @param {string} country
*/
onInput({ number, isValid, country }) {
console.log(number, isValid, country);
},
},
}
</script>
Property value | Type | Default value | Description |
---|---|---|---|
placeholder | string | Enter a phone number | Placeholder for the input |
disabledFetchingCountry | Boolean | false | Disable fetching current country based on IP address of user |
Property value | Arguments | Description |
---|---|---|
onInput | Object | Fires when the input changes with the argument is the object includes { number, isValid, country } |
onBlur | Fires on blur event |
# install dependencies
$ yarn/npm install
# compile demo for development
$ yarn/npm dev
# open Browser and start serve in demo
$ yarn/npm demo:open
# compile dist demo
$ yarn/npm dist:demo
# compile dist
$ yarn/npm dist
made with ❤ by Steven.
FAQs
International Telephone Input with Vue
The npm package vue-tel-input receives a total of 79,110 weekly downloads. As such, vue-tel-input popularity was classified as popular.
We found that vue-tel-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.