所有国家的信息数据(包含图片对应、区号前缀、国家名字、国家缩写)js、ts

介绍

  1. 本文涵盖了很多国家信息(241个国家),每个国家的图片使用spring图片模式(精灵图)切割,样式文件也有;意味着你可以自定义写下拉组件或其他操作

ts信息文件(js则直接删除其中的类型注解就行了)

// Array of country objects for the flag dropdown.

// Here is the criteria for the plugin to support a given country/territory
// - It has an iso2 code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
// - It has it's own country calling code (it is not a sub-region of another country): https://en.wikipedia.org/wiki/List_of_country_calling_codes
// - It has a flag in the region-flags project: https://github.com/behdad/region-flags/tree/gh-pages/png
// - It is supported by libphonenumber (it must be listed on this page): https://github.com/googlei18n/libphonenumber/blob/master/resources/ShortNumberMetadata.xml

// 每个数组对象都含有以下信息
// [
//    Country name,
//    iso2 code,
//    International dial code,
//    Order (if >1 country with same dial code),
//    Area codes
// ]
export interface allCountriesType {
  name: string | number;
  iso2: string | number;
  dialCode: string | number;
  priority: string | number;
  areaCodes: number[] | string[];
}
const allCountries: allCountriesType[] | any[] = [
  ['Afghanistan (‫افغانستان‬‎)', 'af', '93'],
  ['Albania (Shqipëri)', 'al', '355'],
  ['Algeria (‫الجزائر‬‎)', 'dz', '213'],
  ['American Samoa', 'as', '1', 5, ['684']],
  ['Andorra', 'ad', '376'],
  ['Angola', 'ao', '244'],
  ['Anguilla', 'ai', '1', 6, ['264']],
  ['Antigua and Barbuda', 'ag', '1', 7, ['268']],
  ['Argentina', 'ar', '54'],
  ['Armenia (Հայաստան)', 'am', '374'],
  ['Aruba', 'aw', '297'],
  ['Ascension Island', 'ac', '247'],
  ['Australia', 'au', '61', 0],
  ['Austria (Österreich)', 'at', '43'],
  ['Azerbaijan (Azərbaycan)', 'az', '994'],
  ['Bahamas', 'bs', '1', 8, ['242']],
  ['Bahrain (‫البحرين‬‎)', 'bh', '973'],
  ['Bangladesh (বাংলাদেশ)', 'bd', '880'],
  ['Barbados', 'bb', '1', 9, ['246']],
  ['Belarus (Беларусь)', 'by', '375'],
  ['Belgium (België)', 'be', '32'],
  ['Belize', 'bz', '501'],
  ['Benin (Bénin)', 'bj', '229'],
  ['Bermuda', 'bm', '1', 10, ['441']],
  ['Bhutan (འབྲུག)', 'bt', '975'],
  ['Bolivia', 'bo', '591'],
  ['Bosnia and Herzegovina (Босна и Херцеговина)', 'ba', '387'],
  ['Botswana', 'bw', '267'],
  ['Brazil (Brasil)', 'br', '55'],
  ['British Indian Ocean Territory', 'io', '246'],
  ['British Virgin Islands', 'vg', '1', 11, ['284']],
  ['Brunei', 'bn', '673'],
  ['Bulgaria (България)', 'bg', '359'],
  ['Burkina Faso', 'bf', '226'],
  ['Burundi (Uburundi)', 'bi', '257'],
  ['Cambodia (កម្ពុជា)', 'kh', '855'],
  ['Cameroon (Cameroun)', 'cm', '237'],
  [
    'Canada',
    'ca',
    '1',
    1,
    [
      '204',
      '226',
      '236',
      '249',
      '250',
      '263',
      '289',
      '306',
      '343',
      '354',
      '365',
      '367',
      '368',
      '382',
      '387',
      '403',
      '416',
      '418',
      '428',
      '431',
      '437',
      '438',
      '450',
      '584',
      '468',
      '474',
      '506',
      '514',
      '519',
      '548',
      '579',
      '581',
      '584',
      '587',
      '604',
      '613',
      '639',
      '647',
      '672',
      '683',
      '705',
      '709',
      '742',
      '753',
      '778',
      '780',
      '782',
      '807',
      '819',
      '825',
      '867',
      '873',
      '902',
      '905',
    ],
  ],
  ['Cape Verde (Kabu Verdi)', 'cv', '238'],
  ['Caribbean Netherlands', 'bq', '599', 1, ['3', '4', '7']],
  ['Cayman Islands', 'ky', '1', 12, ['345']],
  ['Central African Republic (République centrafricaine)', 'cf', '236'],
  ['Chad (Tchad)', 'td', '235'],
  ['Chile', 'cl', '56'],
  ['China (中国)', 'cn', '86'],
  ['Christmas Island', 'cx', '61', 2, ['89164']],
  ['Cocos (Keeling) Islands', 'cc', '61', 1, ['89162']],
  ['Colombia', 'co', '57'],
  ['Comoros (‫جزر القمر‬‎)', 'km', '269'],
  ['Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)', 'cd', '243'],
  ['Congo (Republic) (Congo-Brazzaville)', 'cg', '242'],
  ['Cook Islands', 'ck', '682'],
  ['Costa Rica', 'cr', '506'],
  ['Côte d’Ivoire', 'ci', '225'],
  ['Croatia (Hrvatska)', 'hr', '385'],
  ['Cuba', 'cu', '53'],
  ['Curaçao', 'cw', '599', 0],
  ['Cyprus (Κύπρος)', 'cy', '357'],
  ['Czech Republic (Česká republika)', 'cz', '420'],
  ['Denmark (Danmark)', 'dk', '45'],
  ['Djibouti', 'dj', '253'],
  ['Dominica', 'dm', '1', 13, ['767']],
  [
    'Dominican Republic (República Dominicana)',
    'do',
    '1',
    2,
    ['809', '829', '849'],
  ],
  ['Ecuador', 'ec', '593'],
  ['Egypt (‫مصر‬‎)', 'eg', '20'],
  ['El Salvador', 'sv', '503'],
  ['Equatorial Guinea (Guinea Ecuatorial)', 'gq', '240'],
  ['Eritrea', 'er', '291'],
  ['Estonia (Eesti)', 'ee', '372'],
  ['Eswatini', 'sz', '268'],
  ['Ethiopia', 'et', '251'],
  ['Falkland Islands (Islas Malvinas)', 'fk', '500'],
  ['Faroe Islands (Føroyar)', 'fo', '298'],
  ['Fiji', 'fj', '679'],
  ['Finland (Suomi)', 'fi', '358', 0],
  ['France', 'fr', '33'],
  ['French Guiana (Guyane française)', 'gf', '594'],
  ['French Polynesia (Polynésie française)', 'pf', '689'],
  ['Gabon', 'ga', '241'],
  ['Gambia', 'gm', '220'],
  ['Georgia (საქართველო)', 'ge', '995'],
  ['Germany (Deutschland)', 'de', '49'],
  ['Ghana (Gaana)', 'gh', '233'],
  ['Gibraltar', 'gi', '350'],
  ['Greece (Ελλάδα)', 'gr', '30'],
  ['Greenland (Kalaallit Nunaat)', 'gl', '299'],
  ['Grenada', 'gd', '1', 14, ['473']],
  ['Guadeloupe', 'gp', '590', 0],
  ['Guam', 'gu', '1', 15, ['671']],
  ['Guatemala', 'gt', '502'],
  ['Guernsey', 'gg', '44', 1, ['1481', '7781', '7839', '7911']],
  ['Guinea (Guinée)', 'gn', '224'],
  ['Guinea-Bissau (Guiné Bissau)', 'gw', '245'],
  ['Guyana', 'gy', '592'],
  ['Haiti', 'ht', '509'],
  ['Honduras', 'hn', '504'],
  ['Hong Kong (香港)', 'hk', '852'],
  ['Hungary (Magyarország)', 'hu', '36'],
  ['Iceland (Ísland)', 'is', '354'],
  ['India (भारत)', 'in', '91'],
  ['Indonesia', 'id', '62'],
  ['Iran (‫ایران‬‎)', 'ir', '98'],
  ['Iraq (‫العراق‬‎)', 'iq', '964'],
  ['Ireland', 'ie', '353'],
  ['Isle of Man', 'im', '44', 2, ['1624', '74576', '7524', '7924', '7624']],
  ['Israel (‫ישראל‬‎)', 'il', '972'],
  ['Italy (Italia)', 'it', '39', 0],
  ['Jamaica', 'jm', '1', 4, ['876', '658']],
  ['Japan (日本)', 'jp', '81'],
  ['Jersey', 'je', '44', 3, ['1534', '7509', '7700', '7797', '7829', '7937']],
  ['Jordan (‫الأردن‬‎)', 'jo', '962'],
  ['Kazakhstan (Казахстан)', 'kz', '7', 1, ['33', '7']],
  ['Kenya', 'ke', '254'],
  ['Kiribati', 'ki', '686'],
  ['Kosovo', 'xk', '383'],
  ['Kuwait (‫الكويت‬‎)', 'kw', '965'],
  ['Kyrgyzstan (Кыргызстан)', 'kg', '996'],
  ['Laos (ລາວ)', 'la', '856'],
  ['Latvia (Latvija)', 'lv', '371'],
  ['Lebanon (‫لبنان‬‎)', 'lb', '961'],
  ['Lesotho', 'ls', '266'],
  ['Liberia', 'lr', '231'],
  ['Libya (‫ليبيا‬‎)', 'ly', '218'],
  ['Liechtenstein', 'li', '423'],
  ['Lithuania (Lietuva)', 'lt', '370'],
  ['Luxembourg', 'lu', '352'],
  ['Macau (澳門)', 'mo', '853'],
  ['Madagascar (Madagasikara)', 'mg', '261'],
  ['Malawi', 'mw', '265'],
  ['Malaysia', 'my', '60'],
  ['Maldives', 'mv', '960'],
  ['Mali', 'ml', '223'],
  ['Malta', 'mt', '356'],
  ['Marshall Islands', 'mh', '692'],
  ['Martinique', 'mq', '596'],
  ['Mauritania (‫موريتانيا‬‎)', 'mr', '222'],
  ['Mauritius (Moris)', 'mu', '230'],
  ['Mayotte', 'yt', '262', 1, ['269', '639']],
  ['Mexico (México)', 'mx', '52'],
  ['Micronesia', 'fm', '691'],
  ['Moldova (Republica Moldova)', 'md', '373'],
  ['Monaco', 'mc', '377'],
  ['Mongolia (Монгол)', 'mn', '976'],
  ['Montenegro (Crna Gora)', 'me', '382'],
  ['Montserrat', 'ms', '1', 16, ['664']],
  ['Morocco (‫المغرب‬‎)', 'ma', '212', 0],
  ['Mozambique (Moçambique)', 'mz', '258'],
  ['Myanmar (Burma) (မြန်မာ)', 'mm', '95'],
  ['Namibia (Namibië)', 'na', '264'],
  ['Nauru', 'nr', '674'],
  ['Nepal (नेपाल)', 'np', '977'],
  ['Netherlands (Nederland)', 'nl', '31'],
  ['New Caledonia (Nouvelle-Calédonie)', 'nc', '687'],
  ['New Zealand', 'nz', '64'],
  ['Nicaragua', 'ni', '505'],
  ['Niger (Nijar)', 'ne', '227'],
  ['Nigeria', 'ng', '234'],
  ['Niue', 'nu', '683'],
  ['Norfolk Island', 'nf', '672'],
  ['North Korea (조선 민주주의 인민 공화국)', 'kp', '850'],
  ['North Macedonia (Северна Македонија)', 'mk', '389'],
  ['Northern Mariana Islands', 'mp', '1', 17, ['670']],
  ['Norway (Norge)', 'no', '47', 0],
  ['Oman (‫عُمان‬‎)', 'om', '968'],
  ['Pakistan (‫پاکستان‬‎)', 'pk', '92'],
  ['Palau', 'pw', '680'],
  ['Palestine (‫فلسطين‬‎)', 'ps', '970'],
  ['Panama (Panamá)', 'pa', '507'],
  ['Papua New Guinea', 'pg', '675'],
  ['Paraguay', 'py', '595'],
  ['Peru (Perú)', 'pe', '51'],
  ['Philippines', 'ph', '63'],
  ['Poland (Polska)', 'pl', '48'],
  ['Portugal', 'pt', '351'],
  ['Puerto Rico', 'pr', '1', 3, ['787', '939']],
  ['Qatar (‫قطر‬‎)', 'qa', '974'],
  ['Réunion (La Réunion)', 're', '262', 0],
  ['Romania (România)', 'ro', '40'],
  ['Russia (Россия)', 'ru', '7', 0],
  ['Rwanda', 'rw', '250'],
  ['Saint Barthélemy', 'bl', '590', 1],
  ['Saint Helena', 'sh', '290'],
  ['Saint Kitts and Nevis', 'kn', '1', 18, ['869']],
  ['Saint Lucia', 'lc', '1', 19, ['758']],
  ['Saint Martin (Saint-Martin (partie française))', 'mf', '590', 2],
  ['Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)', 'pm', '508'],
  ['Saint Vincent and the Grenadines', 'vc', '1', 20, ['784']],
  ['Samoa', 'ws', '685'],
  ['San Marino', 'sm', '378'],
  ['São Tomé and Príncipe (São Tomé e Príncipe)', 'st', '239'],
  ['Saudi Arabia (‫المملكة العربية السعودية‬‎)', 'sa', '966'],
  ['Senegal (Sénégal)', 'sn', '221'],
  ['Serbia (Србија)', 'rs', '381'],
  ['Seychelles', 'sc', '248'],
  ['Sierra Leone', 'sl', '232'],
  ['Singapore', 'sg', '65'],
  ['Sint Maarten', 'sx', '1', 21, ['721']],
  ['Slovakia (Slovensko)', 'sk', '421'],
  ['Slovenia (Slovenija)', 'si', '386'],
  ['Solomon Islands', 'sb', '677'],
  ['Somalia (Soomaaliya)', 'so', '252'],
  ['South Africa', 'za', '27'],
  ['South Korea (대한민국)', 'kr', '82'],
  ['South Sudan (‫جنوب السودان‬‎)', 'ss', '211'],
  ['Spain (España)', 'es', '34'],
  ['Sri Lanka (ශ්‍රී ලංකාව)', 'lk', '94'],
  ['Sudan (‫السودان‬‎)', 'sd', '249'],
  ['Suriname', 'sr', '597'],
  ['Svalbard and Jan Mayen', 'sj', '47', 1, ['79']],
  ['Sweden (Sverige)', 'se', '46'],
  ['Switzerland (Schweiz)', 'ch', '41'],
  ['Syria (‫سوريا‬‎)', 'sy', '963'],
  ['Taiwan (台灣)', 'tw', '886'],
  ['Tajikistan', 'tj', '992'],
  ['Tanzania', 'tz', '255'],
  ['Thailand (ไทย)', 'th', '66'],
  ['Timor-Leste', 'tl', '670'],
  ['Togo', 'tg', '228'],
  ['Tokelau', 'tk', '690'],
  ['Tonga', 'to', '676'],
  ['Trinidad and Tobago', 'tt', '1', 22, ['868']],
  ['Tunisia (‫تونس‬‎)', 'tn', '216'],
  ['Turkey (Türkiye)', 'tr', '90'],
  ['Turkmenistan', 'tm', '993'],
  ['Turks and Caicos Islands', 'tc', '1', 23, ['649']],
  ['Tuvalu', 'tv', '688'],
  ['U.S. Virgin Islands', 'vi', '1', 24, ['340']],
  ['Uganda', 'ug', '256'],
  ['Ukraine (Україна)', 'ua', '380'],
  ['United Arab Emirates (‫الإمارات العربية المتحدة‬‎)', 'ae', '971'],
  ['United Kingdom', 'gb', '44', 0],
  ['United States', 'us', '1', 0],
  ['Uruguay', 'uy', '598'],
  ['Uzbekistan (Oʻzbekiston)', 'uz', '998'],
  ['Vanuatu', 'vu', '678'],
  ['Vatican City (Città del Vaticano)', 'va', '39', 1, ['06698']],
  ['Venezuela', 've', '58'],
  ['Vietnam (Việt Nam)', 'vn', '84'],
  ['Wallis and Futuna (Wallis-et-Futuna)', 'wf', '681'],
  ['Western Sahara (‫الصحراء الغربية‬‎)', 'eh', '212', 1, ['5288', '5289']],
  ['Yemen (‫اليمن‬‎)', 'ye', '967'],
  ['Zambia', 'zm', '260'],
  ['Zimbabwe', 'zw', '263'],
  ['Åland Islands', 'ax', '358', 1, ['18']],
];

// 循环到上面的所有国家/地区,将数据重组为具有命名键的对象
for (let i = 0; i < allCountries.length; i++) {
  const c = allCountries[i];
  allCountries[i] = {
    name: c[0],
    iso2: c[1],
    dialCode: c[2],
    priority: c[3] || 0,
    areaCodes: c[4] || null,
  };
}
export default allCountries;

// 返回区域前缀(例如: 中国 86)
export const handleDefaultCode = ({
  areaCodes,
  dialCode,
}: allCountriesType) => {
  if (areaCodes && areaCodes.length < 2) return `${dialCode}${areaCodes[0]}`;
  return dialCode;
};


获取图片地址请点这里

css图片截取样式

.iti {
  position: relative;
  display: inline-block;
}

.iti * {
  box-sizing: border-box;
}

.iti__hide {
  display: none;
}

.iti__v-hide {
  visibility: hidden;
}

.iti input,
.iti input[type='tel'],
.iti input[type='text'] {
  position: relative;
  z-index: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-right: 36px;
  margin-right: 0;
}

.iti__flag-container {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  padding: 1px;
}

.iti__selected-flag {
  z-index: 1;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 6px 0 8px;
}

.iti__arrow {
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #555;
}

[dir='rtl'] .iti__arrow {
  margin-right: 6px;
  margin-left: 0;
}

.iti__arrow--up {
  border-top: none;
  border-bottom: 4px solid #555;
}

.iti__country-list {
  position: absolute;
  z-index: 2;
  list-style: none;
  padding: 0;
  margin: 0 0 0 -1px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  border: 1px solid #ccc;
  white-space: nowrap;
  max-height: 200px;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

.iti__country-list--dropup {
  bottom: 100%;
  margin-bottom: -1px;
}

@media (max-width: 500px) {
  .iti__country-list {
    white-space: normal;
  }
}

.iti__flag-box {
  display: inline-block;
  width: 20px;
}

.iti__divider {
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid #ccc;
}

.iti__country {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  outline: 0;
}

.iti__dial-code {
  color: #999;
}

.iti__country.iti__highlight {
  background-color: rgba(0, 0, 0, 0.05);
}

.iti__country-name,
.iti__flag-box {
  margin-right: 6px;
}

[dir='rtl'] .iti__country-name,
[dir='rtl'] .iti__flag-box {
  margin-right: 0;
  margin-left: 6px;
}

.iti--allow-dropdown input,
.iti--allow-dropdown input[type='tel'],
.iti--allow-dropdown input[type='text'],
.iti--separate-dial-code input,
.iti--separate-dial-code input[type='tel'],
.iti--separate-dial-code input[type='text'] {
  padding-right: 6px;
  padding-left: 52px;
  margin-left: 0;
}

[dir='rtl'] .iti--allow-dropdown input,
[dir='rtl'] .iti--allow-dropdown input[type='tel'],
[dir='rtl'] .iti--allow-dropdown input[type='text'],
[dir='rtl'] .iti--separate-dial-code input,
[dir='rtl'] .iti--separate-dial-code input[type='tel'],
[dir='rtl'] .iti--separate-dial-code input[type='text'] {
  padding-right: 52px;
  padding-left: 6px;
  margin-right: 0;
}

.iti--allow-dropdown .iti__flag-container,
.iti--separate-dial-code .iti__flag-container {
  right: auto;
  left: 0;
}

[dir='rtl'] .iti--allow-dropdown .iti__flag-container,
[dir='rtl'] .iti--separate-dial-code .iti__flag-container {
  right: 0;
  left: auto;
}

.iti--allow-dropdown .iti__flag-container:hover {
  cursor: pointer;
}

.iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag {
  background-color: rgba(0, 0, 0, 0.05);
}

.iti--allow-dropdown input[disabled] + .iti__flag-container:hover,
.iti--allow-dropdown input[readonly] + .iti__flag-container:hover {
  cursor: default;
}

.iti--allow-dropdown
  input[disabled]
  + .iti__flag-container:hover
  .iti__selected-flag,
.iti--allow-dropdown
  input[readonly]
  + .iti__flag-container:hover
  .iti__selected-flag {
  background-color: transparent;
}

.iti--separate-dial-code .iti__selected-flag {
  background-color: rgba(0, 0, 0, 0.05);
}

.iti--separate-dial-code.iti--show-flags .iti__selected-dial-code {
  margin-left: 6px;
}

[dir='rtl'] .iti--separate-dial-code.iti--show-flags .iti__selected-dial-code {
  margin-left: 0;
  margin-right: 6px;
}

.iti--container {
  position: absolute;
  top: -1000px;
  left: -1000px;
  z-index: 1060;
  padding: 1px;
}

.iti--container:hover {
  cursor: pointer;
}

.iti-mobile .iti--container {
  top: 30px;
  bottom: 30px;
  left: 30px;
  right: 30px;
  position: fixed;
}

.iti-mobile .iti__country-list {
  max-height: 100%;
  width: 100%;
}

.iti-mobile .iti__country {
  padding: 10px 10px;
  line-height: 1.5em;
}

.iti__flag {
  width: 20px;
}

.iti__flag.iti__be {
  width: 18px;
}

.iti__flag.iti__ch {
  width: 15px;
}

.iti__flag.iti__mc {
  width: 19px;
}

.iti__flag.iti__ne {
  width: 18px;
}

.iti__flag.iti__np {
  width: 13px;
}

.iti__flag.iti__va {
  width: 15px;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .iti__flag {
    background-size: 5762px 15px;
  }
}

.iti__flag.iti__ac {
  height: 10px;
  background-position: 0 0;
}

.iti__flag.iti__ad {
  height: 14px;
  background-position: -22px 0;
}

.iti__flag.iti__ae {
  height: 10px;
  background-position: -44px 0;
}

.iti__flag.iti__af {
  height: 14px;
  background-position: -66px 0;
}

.iti__flag.iti__ag {
  height: 14px;
  background-position: -88px 0;
}

.iti__flag.iti__ai {
  height: 10px;
  background-position: -110px 0;
}

.iti__flag.iti__al {
  height: 15px;
  background-position: -132px 0;
}

.iti__flag.iti__am {
  height: 10px;
  background-position: -154px 0;
}

.iti__flag.iti__ao {
  height: 14px;
  background-position: -176px 0;
}

.iti__flag.iti__aq {
  height: 14px;
  background-position: -198px 0;
}

.iti__flag.iti__ar {
  height: 13px;
  background-position: -220px 0;
}

.iti__flag.iti__as {
  height: 10px;
  background-position: -242px 0;
}

.iti__flag.iti__at {
  height: 14px;
  background-position: -264px 0;
}

.iti__flag.iti__au {
  height: 10px;
  background-position: -286px 0;
}

.iti__flag.iti__aw {
  height: 14px;
  background-position: -308px 0;
}

.iti__flag.iti__ax {
  height: 13px;
  background-position: -330px 0;
}

.iti__flag.iti__az {
  height: 10px;
  background-position: -352px 0;
}

.iti__flag.iti__ba {
  height: 10px;
  background-position: -374px 0;
}

.iti__flag.iti__bb {
  height: 14px;
  background-position: -396px 0;
}

.iti__flag.iti__bd {
  height: 12px;
  background-position: -418px 0;
}

.iti__flag.iti__be {
  height: 15px;
  background-position: -440px 0;
}

.iti__flag.iti__bf {
  height: 14px;
  background-position: -460px 0;
}

.iti__flag.iti__bg {
  height: 12px;
  background-position: -482px 0;
}

.iti__flag.iti__bh {
  height: 12px;
  background-position: -504px 0;
}

.iti__flag.iti__bi {
  height: 12px;
  background-position: -526px 0;
}

.iti__flag.iti__bj {
  height: 14px;
  background-position: -548px 0;
}

.iti__flag.iti__bl {
  height: 14px;
  background-position: -570px 0;
}

.iti__flag.iti__bm {
  height: 10px;
  background-position: -592px 0;
}

.iti__flag.iti__bn {
  height: 10px;
  background-position: -614px 0;
}

.iti__flag.iti__bo {
  height: 14px;
  background-position: -636px 0;
}

.iti__flag.iti__bq {
  height: 14px;
  background-position: -658px 0;
}

.iti__flag.iti__br {
  height: 14px;
  background-position: -680px 0;
}

.iti__flag.iti__bs {
  height: 10px;
  background-position: -702px 0;
}

.iti__flag.iti__bt {
  height: 14px;
  background-position: -724px 0;
}

.iti__flag.iti__bv {
  height: 15px;
  background-position: -746px 0;
}

.iti__flag.iti__bw {
  height: 14px;
  background-position: -768px 0;
}

.iti__flag.iti__by {
  height: 10px;
  background-position: -790px 0;
}

.iti__flag.iti__bz {
  height: 12px;
  background-position: -812px 0;
}

.iti__flag.iti__ca {
  height: 10px;
  background-position: -834px 0;
}

.iti__flag.iti__cc {
  height: 10px;
  background-position: -856px 0;
}

.iti__flag.iti__cd {
  height: 15px;
  background-position: -878px 0;
}

.iti__flag.iti__cf {
  height: 14px;
  background-position: -900px 0;
}

.iti__flag.iti__cg {
  height: 14px;
  background-position: -922px 0;
}

.iti__flag.iti__ch {
  height: 15px;
  background-position: -944px 0;
}

.iti__flag.iti__ci {
  height: 14px;
  background-position: -961px 0;
}

.iti__flag.iti__ck {
  height: 10px;
  background-position: -983px 0;
}

.iti__flag.iti__cl {
  height: 14px;
  background-position: -1005px 0;
}

.iti__flag.iti__cm {
  height: 14px;
  background-position: -1027px 0;
}

.iti__flag.iti__cn {
  height: 14px;
  background-position: -1049px 0;
}

.iti__flag.iti__co {
  height: 14px;
  background-position: -1071px 0;
}

.iti__flag.iti__cp {
  height: 14px;
  background-position: -1093px 0;
}

.iti__flag.iti__cq {
  height: 12px;
  background-position: -1115px 0;
}

.iti__flag.iti__cr {
  height: 12px;
  background-position: -1137px 0;
}

.iti__flag.iti__cu {
  height: 10px;
  background-position: -1159px 0;
}

.iti__flag.iti__cv {
  height: 12px;
  background-position: -1181px 0;
}

.iti__flag.iti__cw {
  height: 14px;
  background-position: -1203px 0;
}

.iti__flag.iti__cx {
  height: 10px;
  background-position: -1225px 0;
}

.iti__flag.iti__cy {
  height: 14px;
  background-position: -1247px 0;
}

.iti__flag.iti__cz {
  height: 14px;
  background-position: -1269px 0;
}

.iti__flag.iti__de {
  height: 12px;
  background-position: -1291px 0;
}

.iti__flag.iti__dg {
  height: 10px;
  background-position: -1313px 0;
}

.iti__flag.iti__dj {
  height: 14px;
  background-position: -1335px 0;
}

.iti__flag.iti__dk {
  height: 15px;
  background-position: -1357px 0;
}

.iti__flag.iti__dm {
  height: 10px;
  background-position: -1379px 0;
}

.iti__flag.iti__do {
  height: 14px;
  background-position: -1401px 0;
}

.iti__flag.iti__dz {
  height: 14px;
  background-position: -1423px 0;
}

.iti__flag.iti__ea {
  height: 14px;
  background-position: -1445px 0;
}

.iti__flag.iti__ec {
  height: 14px;
  background-position: -1467px 0;
}

.iti__flag.iti__ee {
  height: 13px;
  background-position: -1489px 0;
}

.iti__flag.iti__eg {
  height: 14px;
  background-position: -1511px 0;
}

.iti__flag.iti__eh {
  height: 10px;
  background-position: -1533px 0;
}

.iti__flag.iti__er {
  height: 10px;
  background-position: -1555px 0;
}

.iti__flag.iti__es {
  height: 14px;
  background-position: -1577px 0;
}

.iti__flag.iti__et {
  height: 10px;
  background-position: -1599px 0;
}

.iti__flag.iti__eu {
  height: 14px;
  background-position: -1621px 0;
}

.iti__flag.iti__ez {
  height: 14px;
  background-position: -1643px 0;
}

.iti__flag.iti__fi {
  height: 12px;
  background-position: -1665px 0;
}

.iti__flag.iti__fj {
  height: 10px;
  background-position: -1687px 0;
}

.iti__flag.iti__fk {
  height: 10px;
  background-position: -1709px 0;
}

.iti__flag.iti__fm {
  height: 11px;
  background-position: -1731px 0;
}

.iti__flag.iti__fo {
  height: 15px;
  background-position: -1753px 0;
}

.iti__flag.iti__fr {
  height: 14px;
  background-position: -1775px 0;
}

.iti__flag.iti__fx {
  height: 14px;
  background-position: -1797px 0;
}

.iti__flag.iti__ga {
  height: 15px;
  background-position: -1819px 0;
}

.iti__flag.iti__gb {
  height: 10px;
  background-position: -1841px 0;
}

.iti__flag.iti__gd {
  height: 12px;
  background-position: -1863px 0;
}

.iti__flag.iti__ge {
  height: 14px;
  background-position: -1885px 0;
}

.iti__flag.iti__gf {
  height: 14px;
  background-position: -1907px 0;
}

.iti__flag.iti__gg {
  height: 14px;
  background-position: -1929px 0;
}

.iti__flag.iti__gh {
  height: 14px;
  background-position: -1951px 0;
}

.iti__flag.iti__gi {
  height: 10px;
  background-position: -1973px 0;
}

.iti__flag.iti__gl {
  height: 14px;
  background-position: -1995px 0;
}

.iti__flag.iti__gm {
  height: 14px;
  background-position: -2017px 0;
}

.iti__flag.iti__gn {
  height: 14px;
  background-position: -2039px 0;
}

.iti__flag.iti__gp {
  height: 14px;
  background-position: -2061px 0;
}

.iti__flag.iti__gq {
  height: 14px;
  background-position: -2083px 0;
}

.iti__flag.iti__gr {
  height: 14px;
  background-position: -2105px 0;
}

.iti__flag.iti__gs {
  height: 10px;
  background-position: -2127px 0;
}

.iti__flag.iti__gt {
  height: 13px;
  background-position: -2149px 0;
}

.iti__flag.iti__gu {
  height: 11px;
  background-position: -2171px 0;
}

.iti__flag.iti__gw {
  height: 10px;
  background-position: -2193px 0;
}

.iti__flag.iti__gy {
  height: 12px;
  background-position: -2215px 0;
}

.iti__flag.iti__hk {
  height: 14px;
  background-position: -2237px 0;
}

.iti__flag.iti__hm {
  height: 10px;
  background-position: -2259px 0;
}

.iti__flag.iti__hn {
  height: 10px;
  background-position: -2281px 0;
}

.iti__flag.iti__hr {
  height: 10px;
  background-position: -2303px 0;
}

.iti__flag.iti__ht {
  height: 12px;
  background-position: -2325px 0;
}

.iti__flag.iti__hu {
  height: 10px;
  background-position: -2347px 0;
}

.iti__flag.iti__ic {
  height: 14px;
  background-position: -2369px 0;
}

.iti__flag.iti__id {
  height: 14px;
  background-position: -2391px 0;
}

.iti__flag.iti__ie {
  height: 10px;
  background-position: -2413px 0;
}

.iti__flag.iti__il {
  height: 15px;
  background-position: -2435px 0;
}

.iti__flag.iti__im {
  height: 10px;
  background-position: -2457px 0;
}

.iti__flag.iti__in {
  height: 14px;
  background-position: -2479px 0;
}

.iti__flag.iti__io {
  height: 10px;
  background-position: -2501px 0;
}

.iti__flag.iti__iq {
  height: 14px;
  background-position: -2523px 0;
}

.iti__flag.iti__ir {
  height: 12px;
  background-position: -2545px 0;
}

.iti__flag.iti__is {
  height: 15px;
  background-position: -2567px 0;
}

.iti__flag.iti__it {
  height: 14px;
  background-position: -2589px 0;
}

.iti__flag.iti__je {
  height: 12px;
  background-position: -2611px 0;
}

.iti__flag.iti__jm {
  height: 10px;
  background-position: -2633px 0;
}

.iti__flag.iti__jo {
  height: 10px;
  background-position: -2655px 0;
}

.iti__flag.iti__jp {
  height: 14px;
  background-position: -2677px 0;
}

.iti__flag.iti__ke {
  height: 14px;
  background-position: -2699px 0;
}

.iti__flag.iti__kg {
  height: 12px;
  background-position: -2721px 0;
}

.iti__flag.iti__kh {
  height: 13px;
  background-position: -2743px 0;
}

.iti__flag.iti__ki {
  height: 10px;
  background-position: -2765px 0;
}

.iti__flag.iti__km {
  height: 12px;
  background-position: -2787px 0;
}

.iti__flag.iti__kn {
  height: 14px;
  background-position: -2809px 0;
}

.iti__flag.iti__kp {
  height: 10px;
  background-position: -2831px 0;
}

.iti__flag.iti__kr {
  height: 14px;
  background-position: -2853px 0;
}

.iti__flag.iti__kw {
  height: 10px;
  background-position: -2875px 0;
}

.iti__flag.iti__ky {
  height: 10px;
  background-position: -2897px 0;
}

.iti__flag.iti__kz {
  height: 10px;
  background-position: -2919px 0;
}

.iti__flag.iti__la {
  height: 14px;
  background-position: -2941px 0;
}

.iti__flag.iti__lb {
  height: 14px;
  background-position: -2963px 0;
}

.iti__flag.iti__lc {
  height: 10px;
  background-position: -2985px 0;
}

.iti__flag.iti__li {
  height: 12px;
  background-position: -3007px 0;
}

.iti__flag.iti__lk {
  height: 10px;
  background-position: -3029px 0;
}

.iti__flag.iti__lr {
  height: 11px;
  background-position: -3051px 0;
}

.iti__flag.iti__ls {
  height: 14px;
  background-position: -3073px 0;
}

.iti__flag.iti__lt {
  height: 12px;
  background-position: -3095px 0;
}

.iti__flag.iti__lu {
  height: 12px;
  background-position: -3117px 0;
}

.iti__flag.iti__lv {
  height: 10px;
  background-position: -3139px 0;
}

.iti__flag.iti__ly {
  height: 10px;
  background-position: -3161px 0;
}

.iti__flag.iti__ma {
  height: 14px;
  background-position: -3183px 0;
}

.iti__flag.iti__mc {
  height: 15px;
  background-position: -3205px 0;
}

.iti__flag.iti__md {
  height: 10px;
  background-position: -3226px 0;
}

.iti__flag.iti__me {
  height: 10px;
  background-position: -3248px 0;
}

.iti__flag.iti__mf {
  height: 14px;
  background-position: -3270px 0;
}

.iti__flag.iti__mg {
  height: 14px;
  background-position: -3292px 0;
}

.iti__flag.iti__mh {
  height: 11px;
  background-position: -3314px 0;
}

.iti__flag.iti__mk {
  height: 10px;
  background-position: -3336px 0;
}

.iti__flag.iti__ml {
  height: 14px;
  background-position: -3358px 0;
}

.iti__flag.iti__mm {
  height: 14px;
  background-position: -3380px 0;
}

.iti__flag.iti__mn {
  height: 10px;
  background-position: -3402px 0;
}

.iti__flag.iti__mo {
  height: 14px;
  background-position: -3424px 0;
}

.iti__flag.iti__mp {
  height: 10px;
  background-position: -3446px 0;
}

.iti__flag.iti__mq {
  height: 14px;
  background-position: -3468px 0;
}

.iti__flag.iti__mr {
  height: 14px;
  background-position: -3490px 0;
}

.iti__flag.iti__ms {
  height: 10px;
  background-position: -3512px 0;
}

.iti__flag.iti__mt {
  height: 14px;
  background-position: -3534px 0;
}

.iti__flag.iti__mu {
  height: 14px;
  background-position: -3556px 0;
}

.iti__flag.iti__mv {
  height: 14px;
  background-position: -3578px 0;
}

.iti__flag.iti__mw {
  height: 14px;
  background-position: -3600px 0;
}

.iti__flag.iti__mx {
  height: 12px;
  background-position: -3622px 0;
}

.iti__flag.iti__my {
  height: 10px;
  background-position: -3644px 0;
}

.iti__flag.iti__mz {
  height: 14px;
  background-position: -3666px 0;
}

.iti__flag.iti__na {
  height: 14px;
  background-position: -3688px 0;
}

.iti__flag.iti__nc {
  height: 10px;
  background-position: -3710px 0;
}

.iti__flag.iti__ne {
  height: 15px;
  background-position: -3732px 0;
}

.iti__flag.iti__nf {
  height: 10px;
  background-position: -3752px 0;
}

.iti__flag.iti__ng {
  height: 10px;
  background-position: -3774px 0;
}

.iti__flag.iti__ni {
  height: 12px;
  background-position: -3796px 0;
}

.iti__flag.iti__nl {
  height: 14px;
  background-position: -3818px 0;
}

.iti__flag.iti__no {
  height: 15px;
  background-position: -3840px 0;
}

.iti__flag.iti__np {
  height: 15px;
  background-position: -3862px 0;
}

.iti__flag.iti__nr {
  height: 10px;
  background-position: -3877px 0;
}

.iti__flag.iti__nu {
  height: 10px;
  background-position: -3899px 0;
}

.iti__flag.iti__nz {
  height: 10px;
  background-position: -3921px 0;
}

.iti__flag.iti__om {
  height: 10px;
  background-position: -3943px 0;
}

.iti__flag.iti__pa {
  height: 14px;
  background-position: -3965px 0;
}

.iti__flag.iti__pe {
  height: 14px;
  background-position: -3987px 0;
}

.iti__flag.iti__pf {
  height: 14px;
  background-position: -4009px 0;
}

.iti__flag.iti__pg {
  height: 15px;
  background-position: -4031px 0;
}

.iti__flag.iti__ph {
  height: 10px;
  background-position: -4053px 0;
}

.iti__flag.iti__pk {
  height: 14px;
  background-position: -4075px 0;
}

.iti__flag.iti__pl {
  height: 13px;
  background-position: -4097px 0;
}

.iti__flag.iti__pm {
  height: 14px;
  background-position: -4119px 0;
}

.iti__flag.iti__pn {
  height: 10px;
  background-position: -4141px 0;
}

.iti__flag.iti__pr {
  height: 14px;
  background-position: -4163px 0;
}

.iti__flag.iti__ps {
  height: 10px;
  background-position: -4185px 0;
}

.iti__flag.iti__pt {
  height: 14px;
  background-position: -4207px 0;
}

.iti__flag.iti__pw {
  height: 13px;
  background-position: -4229px 0;
}

.iti__flag.iti__py {
  height: 11px;
  background-position: -4251px 0;
}

.iti__flag.iti__qa {
  height: 8px;
  background-position: -4273px 0;
}

.iti__flag.iti__re {
  height: 14px;
  background-position: -4295px 0;
}

.iti__flag.iti__ro {
  height: 14px;
  background-position: -4317px 0;
}

.iti__flag.iti__rs {
  height: 14px;
  background-position: -4339px 0;
}

.iti__flag.iti__ru {
  height: 14px;
  background-position: -4361px 0;
}

.iti__flag.iti__rw {
  height: 14px;
  background-position: -4383px 0;
}

.iti__flag.iti__sa {
  height: 14px;
  background-position: -4405px 0;
}

.iti__flag.iti__sb {
  height: 10px;
  background-position: -4427px 0;
}

.iti__flag.iti__sc {
  height: 10px;
  background-position: -4449px 0;
}

.iti__flag.iti__sd {
  height: 10px;
  background-position: -4471px 0;
}

.iti__flag.iti__se {
  height: 13px;
  background-position: -4493px 0;
}

.iti__flag.iti__sg {
  height: 14px;
  background-position: -4515px 0;
}

.iti__flag.iti__sh {
  height: 10px;
  background-position: -4537px 0;
}

.iti__flag.iti__si {
  height: 10px;
  background-position: -4559px 0;
}

.iti__flag.iti__sj {
  height: 15px;
  background-position: -4581px 0;
}

.iti__flag.iti__sk {
  height: 14px;
  background-position: -4603px 0;
}

.iti__flag.iti__sl {
  height: 14px;
  background-position: -4625px 0;
}

.iti__flag.iti__sm {
  height: 15px;
  background-position: -4647px 0;
}

.iti__flag.iti__sn {
  height: 14px;
  background-position: -4669px 0;
}

.iti__flag.iti__so {
  height: 14px;
  background-position: -4691px 0;
}

.iti__flag.iti__sr {
  height: 14px;
  background-position: -4713px 0;
}

.iti__flag.iti__ss {
  height: 10px;
  background-position: -4735px 0;
}

.iti__flag.iti__st {
  height: 10px;
  background-position: -4757px 0;
}

.iti__flag.iti__su {
  height: 10px;
  background-position: -4779px 0;
}

.iti__flag.iti__sv {
  height: 12px;
  background-position: -4801px 0;
}

.iti__flag.iti__sx {
  height: 14px;
  background-position: -4823px 0;
}

.iti__flag.iti__sy {
  height: 14px;
  background-position: -4845px 0;
}

.iti__flag.iti__sz {
  height: 14px;
  background-position: -4867px 0;
}

.iti__flag.iti__ta {
  height: 10px;
  background-position: -4889px 0;
}

.iti__flag.iti__tc {
  height: 10px;
  background-position: -4911px 0;
}

.iti__flag.iti__td {
  height: 14px;
  background-position: -4933px 0;
}

.iti__flag.iti__tf {
  height: 14px;
  background-position: -4955px 0;
}

.iti__flag.iti__tg {
  height: 13px;
  background-position: -4977px 0;
}

.iti__flag.iti__th {
  height: 14px;
  background-position: -4999px 0;
}

.iti__flag.iti__tj {
  height: 10px;
  background-position: -5021px 0;
}

.iti__flag.iti__tk {
  height: 10px;
  background-position: -5043px 0;
}

.iti__flag.iti__tl {
  height: 10px;
  background-position: -5065px 0;
}

.iti__flag.iti__tm {
  height: 14px;
  background-position: -5087px 0;
}

.iti__flag.iti__tn {
  height: 14px;
  background-position: -5109px 0;
}

.iti__flag.iti__to {
  height: 10px;
  background-position: -5131px 0;
}

.iti__flag.iti__tr {
  height: 14px;
  background-position: -5153px 0;
}

.iti__flag.iti__tt {
  height: 12px;
  background-position: -5175px 0;
}

.iti__flag.iti__tv {
  height: 10px;
  background-position: -5197px 0;
}

.iti__flag.iti__tw {
  height: 14px;
  background-position: -5219px 0;
}

.iti__flag.iti__tz {
  height: 14px;
  background-position: -5241px 0;
}

.iti__flag.iti__ua {
  height: 14px;
  background-position: -5263px 0;
}

.iti__flag.iti__ug {
  height: 14px;
  background-position: -5285px 0;
}

.iti__flag.iti__uk {
  height: 10px;
  background-position: -5307px 0;
}

.iti__flag.iti__um {
  height: 11px;
  background-position: -5329px 0;
}

.iti__flag.iti__un {
  height: 14px;
  background-position: -5351px 0;
}

.iti__flag.iti__us {
  height: 11px;
  background-position: -5373px 0;
}

.iti__flag.iti__uy {
  height: 14px;
  background-position: -5395px 0;
}

.iti__flag.iti__uz {
  height: 10px;
  background-position: -5417px 0;
}

.iti__flag.iti__va {
  height: 15px;
  background-position: -5439px 0;
}

.iti__flag.iti__vc {
  height: 14px;
  background-position: -5456px 0;
}

.iti__flag.iti__ve {
  height: 14px;
  background-position: -5478px 0;
}

.iti__flag.iti__vg {
  height: 10px;
  background-position: -5500px 0;
}

.iti__flag.iti__vi {
  height: 14px;
  background-position: -5522px 0;
}

.iti__flag.iti__vn {
  height: 14px;
  background-position: -5544px 0;
}

.iti__flag.iti__vu {
  height: 12px;
  background-position: -5566px 0;
}

.iti__flag.iti__wf {
  height: 14px;
  background-position: -5588px 0;
}

.iti__flag.iti__ws {
  height: 10px;
  background-position: -5610px 0;
}

.iti__flag.iti__xk {
  height: 15px;
  background-position: -5632px 0;
}

.iti__flag.iti__ye {
  height: 14px;
  background-position: -5654px 0;
}

.iti__flag.iti__yt {
  height: 14px;
  background-position: -5676px 0;
}

.iti__flag.iti__za {
  height: 14px;
  background-position: -5698px 0;
}

.iti__flag.iti__zm {
  height: 14px;
  background-position: -5720px 0;
}

.iti__flag.iti__zw {
  height: 10px;
  background-position: -5742px 0;
}

.iti__flag {
  height: 15px;
  box-shadow: 0 0 1px 0 #888;
  background-image: url(../../../assets/imgs/common/phoneNumber.png);
  background-repeat: no-repeat;
  background-color: #dbdbdb;
  background-position: 20px 0;
}

// @media (-webkit-min-device-pixel-ratio:2),
// (min-resolution:192dpi) {
//   .iti__flag {
//     background-image: url(../../../assets/imgs/common/phoneNumber.png)
//   }
// }

.iti__flag.iti__np {
  background-color: transparent;
}

使用

<div class="iti__flag iti__bi">div>
<div class="iti__flag iti__bq">div>
<div class="iti__flag iti__cn">div>

参考及总结

1.intl-tel-input
2.本文仅作于笔记,侵删。

你可能感兴趣的:(javascript)