【文件属性】:
文件名称:react-phone-number-input:国际电话号码输入的React组件
文件大小:1.45MB
文件格式:ZIP
更新时间:2021-02-19 17:11:49
react phone number JavaScript
React电话号码输入
React的国际电话号码<input/> 。
安装
npm install react-phone-number-input --save
如果您不使用捆绑器,请使用的。
该组件使用进行电话号码解析和格式化。
使用
该组件有两个变体:“有国家选择”和“无国家选择”。
与国家选择
“使用国家/地区选择”组件需要两个属性: value和onChange(value) 。 。
import 'react-phone-number-input/style.css'
import PhoneInput from 'react-phone-number-input'
function Example ( ) {
// `value` will be the parsed phone number in E.164 format.
// Example: "+121