hantrongbinh / vue-country-code

Vue2 Country Code Select
https://hantrongbinh.github.io/vue-country-code/
MIT License
23 stars 16 forks source link

vue-country-code

Country Code Select with Vue.

Checkout Demo at Github pages.

Installation

Usage

Props

Property value Type Default value Description
defaultCountry string '' Default country, will override the country fetched from IP address of user
disabledFetchingCountry Boolean false Disable fetching current country based on IP address of user
enabledCountryCode Boolean false Enable country code in the input
enabledFlags Boolean true Enable flags in the input
preferredCountries Array [] Preferred countries list, will be on top of the dropdown. ie ['AU', 'BR']
onlyCountries Array [] List of countries will be shown on the dropdown. ie ['AU', 'BR']
ignoredCountries Array [] List of countries will NOT be shown on the dropdown. ie ['AU', 'BR']
dropdownOptions Object { disabledDialCode: false } Options for dropdown, supporting disabledDialCode

Events

Property value Arguments Description
onSelect Object Fires when the input changes with the argument is the object includes { name, iso2, dialCode }

Highlights & Credits

Demo Usage


# install dependencies
$ yarn/npm install

# compile demo and start serve for development
$ yarn/npm dev

# build
$ yarn/npm build

Made by Mon.