npm.io
0.2.2 • Published 8 years ago

react-city-mobile

Licence
ISC
Version
0.2.2
Deps
2
Size
100 kB
Vulns
0
Weekly
0
Stars
1

React City Mobile

Introduction

Installation

npm install --save react-city-mobile

or

yarn install react-city-mobile

How to use?

import React from 'react';
import RCity from 'react-city-mobile';
const cityData = require('../city.json');
const ChoiceCityTest = props => {
> return (
>> <RCity citys={ cityData }></RCity>
>  )
}
export default ChoiceCityTest;
Props

citys is the data source for the entire component.

Data Format (Importance!!)
{
    "resCitys": {
      "A": [  //catalog name
        {
          "region_id": "807",
          "name": "阿克苏" //city name
        },
      ],
      "B": [
        {
          "region_id": "807",
          "name": "阿克苏"
        }
      ]
    },
    "hots": [
      {
        "region_id": "813",
        "name": "阿勒泰"
      }
    ]
}