Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@kingscode/vuetify-phone-input
Advanced tools
Readme
Please refer to the TextField if you want to see which inherited props will be available.
Name | Type | Default |
---|---|---|
value | string | '' |
countries | [] | countries |
type | string | tel |
placeholder | string | # |
countryCode | string -number | '' |
prependCountryCode | boolean | true |
Name | Return value | What |
---|---|---|
@country | string | The new selected country code |
@phone | string | Equivalent to @change event, but with additional features. Gets called on blur |
install the dependency
npm i @kingscode/vuetify-phone-input
Then just import the component in the file you need it
import VuetifyPhoneInput from '@kingscode/vuetify-phone-input';
And add it to the components in your vue file
components: {
VuetifyPhoneInput,
...
<template>
<div>
<VuetifyPhoneInput :countries="countries"
@country="onCountry"
@phone="onPhone"/>
</div>
</template>
<script lang="js">
import VuetifyPhoneInput from '@kingscode/vuetify-phone-input';
export default {
name: 'Home',
components: {
VuetifyPhoneInput
},
computed: {
countries: () => [ // we can now provide our own list of countries + codes. Defaults to all possible countries.
{
code: 31,
name: 'NL',
},
{
code: 32,
name: 'BE',
},
],
},
methods: {
onCountry(country) { // callback when the consumer changed the country code.
console.log(country); // 32
},
onPhone(phone) { // callback when the consumer changed the phone number
console.log(phone); // +31612345678
},
},
};
</script>
If the consumer enters the following: +32612345678
when the current selected country does not match, the country will be adjusted accordingly.
Remember that this Phone Input is derived from the VTextField
from Vuetify, meaning that you can still use the error-messages
, or placeholder
attributes for example.
FAQs
A Vuetify form control usable for phone numbers. Supports country code, auto formatting and country code recognition
The npm package @kingscode/vuetify-phone-input receives a total of 136 weekly downloads. As such, @kingscode/vuetify-phone-input popularity was classified as not popular.
We found that @kingscode/vuetify-phone-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.