An open API service indexing awesome lists of open source software.

https://github.com/boussadjra/vueye-phone-input

phone number input built for Vue.js 3
https://github.com/boussadjra/vueye-phone-input

phone-input phone-validation vue-input vuejs-components vuejs3

Last synced: about 2 months ago
JSON representation

phone number input built for Vue.js 3

Awesome Lists containing this project

README

        

# vueye-phone-input

## Description :

It's a rich component that allows you to type a validate phone number, this component is based on [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js), this component supports only Vue.js 3.x

## Installation

npm install vueye-phone-input --save

## DEMO

[LIVE DEMO](https://boussadjra.github.io/vueye-phone-input/)

[Boilerplate](https://codesandbox.io/s/vueye-phone-input-l91zs?file=/src/App.vue)

## Usage

```js



Your phone number :




{{ phone }}


import { defineComponent } from "vue";
import VueyePhoneInput from "vueye-phone-input";

export default defineComponent({
name: "app",
components: {
VueyePhoneInput,
},
data() {
return {
phone: {
number: "",
nationalNumber: "",
isValid:false
},
};
},
});

```

## Props:

|Name|default|description|
|---------|-------|------|
|v-model |`null`| the two-way bound value |
|shape | `'rounded'` | define the component shape (`rounded`,`rounded-none`,`rounded-full`)|
|outlined | `false`| show the component with/out an outline |
|raised| `false`| add an elevation to the component|
|status| `''`|Specify the input status (`'error'`, `'success'` or `''`)|
|placeholder| `''`|The input placeholder|

## Events :

|Name|description|params|
|---------|-------|------|
|blur | Triggered on blur event| `(e:Event)=>{}`|
|focus | Triggered on focus event|`(e:Event)=>{}`|
| click-dropdown | Triggered on open dropdown|`(e:Event,showDropdown:Boolean)=>{}`|
| click-dropdown | Emitted on selecting new country|`(e:Event,country:{name: string,nativeName: string, callCode: number | null, flag: string,code: string})=>{}`|

### Credits :

Thanks to the maintainers of :

- [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js)
- [restcountries](https://restcountries.eu/)
- [ip2c](https://ip2c.org/s)
-

Coded with ❤ by Boussadjra Brahim