Phone Input

Ready to use phone input component with country code dropdown, with validation and formatting. The component extend the <BaseInput> component, so you can use all the props and events of the base component.

This component uses libphonenumber-js and country-codes-list to detect and validate the phone input value.
نمایش کد
vue

Country Input

The component provides a country dropdown to select the country code, you can use the country prop to set the default country, otherwise it will be detected from the user's input. You can use the v-model:country notation to get the selected/detected country code.

نمایش کد
vue

By default, the input value will be formatted in the international format, you can change this behavior with the format prop to change it to national.

نمایش کد
vue

Validation

The component provides a @validation event to indicate if the input value is valid or not

نمایش کد
vue

Disabled State

نمایش کد
vue

Input Size

نمایش کد
vue

Input Shapes

نمایش کد
vue
v-model
The value of the input.
نمایش مثال
vue
country
Default country code, in ISO 3166-1 alpha-2 format.
نمایش مثال
vue
disabled
نمایش مثال
vue
error
An error message or boolean value indicating whether the input is in an error state.
نمایش مثال
vue
format
When set to `national`, the country indicator is omitted.
نمایش مثال
vue
height
The max height of the dropdown.
نمایش مثال
vue
icon
Default icon used when no country is selected/detected.
نمایش مثال
vue
item-height
The height of each dropdown item.
نمایش مثال
vue
rounded
The radius of the input.
نمایش مثال
vue
size
The size of the input.
نمایش مثال
vue
@validation
نمایش مثال
vue
@update:country
نمایش مثال
vue
#country-label
نمایش مثال
vue
#country-placeholder
نمایش مثال
vue
#country-item
نمایش مثال
vue
#action
نمایش مثال
vue
validation
نمایش مثال
vue
currentCountry
نمایش مثال
vue
possibleCountries
نمایش مثال
vue
filter
نمایش مثال
vue
filterRef
نمایش مثال
vue
dropdownRef
نمایش مثال
vue
inputRef
نمایش مثال
vue