[](https://www.npmjs.com/package/element-china-area-data)   !npm !GitHub top language !npm bundle size !GitHub
0. 改用全新脚手架构建,同时支持 CommonJS 和 ESM modules
1. 去掉了 provinceAndCityDataPlus/regionDataPlus/TextToCode,全选功能请利用级联组件自身的
2. CodeToText 修改为 codeToText
3. 添加了纯汉字的数据对象 pcTextArr 和 pcaTextArr
4. 不再支持港澳台,使用新的数据源https://github.com/modood/Administrative-divisions-of-China
``bash`
npm install element-china-area-data -S
`js`
import {
provinceAndCityData,
pcTextArr,
regionData,
pcaTextArr,
codeToText,
} from "element-china-area-data";
1. provinceAndCityData省市二级联动数据,汉字+coderegionData
2. 省市区三级联动数据pcTextArr
3. 省市联动数据,纯汉字pcaTextArr
4. 省市区联动数据,纯汉字codeToText
5. 是个大对象,属性是区域码,属性值是汉字 用法例如:codeToText['110000']输出北京市
- 省市二级联动:
`js
:options="provinceAndCityData"
v-model="selectedOptions">
`
- 省市二级联动,纯汉字:
`js
:options="pcTextArr"
v-model="selectedOptions">
`
- 省市区三级联动
`js
:options="regionData"
v-model="selectedOptions">
`
- 省市区三级联动,纯汉字
`js
:options="pcaTextArr"
v-model="selectedOptions">
`
`html``
Administrative-divisions-of-China
- dev - starts dev server
- build - generates the following bundles: CommonJS (.cjs) ESM (.mjs) and IIFE (.iife.js). The name of bundle isautomatically taken from package.json name property
- test - starts vitest and runs all tests
- test:coverage - starts vitest and run all tests with code coverage report
- lint:scripts - lint .ts files with eslint
- lint:styles - lint .css and .scss files with stylelint
- format:scripts - format .ts, .html and .json files with prettier
- format:styles - format .cs and .scss files with stylelint
- format - format all with prettier and stylelint
- prepare - script for setting up husky pre-commit hook
- uninstall-husky - script for removing husky from repository