https://github.com/futurewan/react-region-picker
https://github.com/futurewan/react-region-picker
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/futurewan/react-region-picker
- Owner: futurewan
- Created: 2020-07-15T09:10:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T10:15:40.000Z (almost 6 years ago)
- Last Synced: 2025-04-13T20:54:19.730Z (about 1 year ago)
- Language: JavaScript
- Size: 64.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-region-picker
react hooks版本 城市地区联动
## install
```
npm install --save react-region-picker
```
## usage
```
import CityPicker from 'react-region-picker';
import CityData from 'react-region-picker/lib/city.json';
import 'react-region-picker/lib/style.css';
```
## API
| 属性 | 说明 | 类型 | 默认值 |
| :---------- | :--- | :--- | :--- |
| regionList | 数据源 | Array | - |
| data | 选中值 | Array | - |
| maskCanClose | 点击遮罩是否可以关闭 | Boolean | true |
| isShowPicker | 主动显示 | Boolean | false |
| placeholder | 默认显示文案 | String | '请选择城市' |
| onFinish | 城市选择完成回调 | Function | - |
| onCancel | 取消城市选择回调 | Function | - |