Technology Sharing

ElementUI's China Province and City Cascading Data Plugin element-china-area-data

2024-07-11

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Install

npm install element-china-area-data -S

Import Usage

import {
  provinceAndCityData,
  pcTextArr,
  regionData,
  pcaTextArr,
  codeToText,
} from "element-china-area-data";
  1. provinceAndCityDataProvincial and municipal secondary linkage data, Chinese code
  2. regionDataProvincial, municipal and district three-level linkage data
  3. pcTextArrProvincial and municipal linkage data, pure Chinese characters
  4. pcaTextArrProvincial, municipal and district linkage data, pure Chinese characters
  5. codeToTextIt is a large object, the attribute is the area code, and the attribute value is the Chinese character usage, for example:codeToText['110000']Output北京市