@breezez/react-country-code-selector
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

CountrySelector

国家手机区号选择器移动端组件,仿微信通讯录交互、支持多种语言显示。

效果演示

演示gif

代码演示

import React,{useState} from 'react';
import { CountrySelector } from '@breezez/react-country-code-selector';

export default () => {
  const [visible, setVisible] = useState(true)
  return (
    <>
    {
      visible  
        ? <CountrySelector
          language={'cn-hk'}
          onClose={()=> setVisible(false)} 
          dispatch={(values)=> console.log(values)}
        />
      : null
    }
    </>
  );
}

API

属性 说明 类型 默认值
language 国家语言 cn、cn-hk、en 可选,默认cn简体
onClose 关闭弹窗 ()=> void 必须
dispatch 选择国家 ({areaCode, country})=> void 必须

Package Sidebar

Install

npm i @breezez/react-country-code-selector

Weekly Downloads

5

Version

1.1.2

License

MIT

Unpacked Size

74.5 kB

Total Files

11

Last publish

Collaborators

  • breezez