项目作者: gaoziyang-dailyAccount

项目描述 :
react city selector
高级语言: JavaScript
项目地址: git://github.com/gaoziyang-dailyAccount/react-city-selector_China.git


react-city-selector_China

A ReactJS component to render a city selector for Chinese Cities.

Installation

Install react-city-selector with npm:

  1. $ npm install react-city-selector

Usage

Very easy to use. Just provide props with total amount of things that you want to display on the page.

  1. import React, { Component } from "react";
  2. import ReactDOM from "react-dom";
  3. import CitySelector from "react-city-selector";
  4. ReactDOM.render(
  5. <CitySelector onTabsChange={onTabsChange} onCityChange={onCityChange}></CitySelector>, document.getElementById("root")
  6. )

Params

Name Type Default Description
onTabsChange Function cities’ first letter tabs change handler
onCityChange Function selected city change handler. Receive selected name as arg

example image