1.1.10 • Published 3 years ago

react-chinese-city-selector v1.1.10

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-chinese-city-selector

A React chinese city selector component

Install

npm install react-chinese-city-selector

Usage

import CitySelector from "react-chinese-city-selector";
import "react-chinese-city-selector/dist/index.css";
<CitySelector value={text} onSelect={onSelect}></CitySelector>

Example

function App() {
  const onSelect = (
    e: React.MouseEvent<HTMLElement>,
    data: { province: string; city: string }
  ) => {
    console.log("Do something");
  };
  return (
   <div className="App">
      <div
        style={{
          width: "220px",
          height: "40px",
          margin: "0 auto",
          marginTop: "10px",
        }}
      >
        <CitySelector
          size="medium"
          value={"沈阳市"}
          onSelect={onSelect}
        ></CitySelector>
      </div>
    </div>
  );
}

ezgif com-gif-maker (1)

Properties

nametypedescription
value{string}初始值,例如“沈阳市“
placeholder{string}自定义 placeholder
onSelect{func}回调方法,返回省份及城市信息
size{string}字体大小,例如”mini,tiny,small,medium,large,big,huge,massive“
1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago