react-china-location
React Component for china-location
It uses the simple html select/option tag,
to use custom UI, install the china-location
only and make your own UI component.
Usage
npm install china-location react-china-location --save
or
yarn add china-location react-china-location
;; Component { superprops; thisonLocationChange = thisonLocationChange; thisstate = currentLocation: {} } { //{ // province: {code: '110000', name: '北京市'}, // city: {code: '110000', name: '北京市'}, // district: {code: '110101', name: '东城区'} //} console; this; } { <div> <ChinaLocation list=locationData onLocationChange=thisonLocationChange/> </div> }
Props
- list: location data from
china-location
- onLocationChange: be notified when user select different option
Demo
Go to demo/build
and open index.html
in your browser.
LICENSE
MIT