Get the latest version by NPM:
$ npm i @craydel-v3/craydel-phone-field
Import the module chosen directly in your component
<script>
import CraydelPhoneField from "@craydel-v3/craydel-phone-field/src/CraydelPhoneField.vue";
export default {
components: {CraydelPhoneField}
}
</script>
Name | Type | Default | Description |
---|---|---|---|
id | string | random ID | Sets the DOM id on the component. |
is-required | boolean | false | Puts component in a required state. |
required-error | string | 'Field is required' | Puts the component in an error state and passes through the custom required error message. |
country-code | string | undefined | Sets the default country code. |
placeholder | string | undefined | Sets the placeholder for the component. |
disabled | boolean | false | Disables the component. |
fetch-country | boolean | false | Gets the default country code via https://ipwho.is |
An example showing a phone field.
<craydel-phone-field fetch-country></craydel-phone-field>