Gathering detailed insights and metrics for element-china-area-data-lg
Gathering detailed insights and metrics for element-china-area-data-lg
Gathering detailed insights and metrics for element-china-area-data-lg
Gathering detailed insights and metrics for element-china-area-data-lg
🇨🇳 Element UI && antd Cascader级联选择器 中国省市区三级、二级联动option数据
npm install element-china-area-data-lg
Typescript
Module System
Node Version
NPM Version
TypeScript (92.94%)
HTML (5.92%)
Shell (1.14%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,329 Stars
31 Commits
216 Forks
22 Watchers
2 Branches
1 Contributors
Updated on Jul 04, 2025
Latest Version
5.0.7
Package Id
element-china-area-data-lg@5.0.7
Unpacked Size
6.13 MB
Size
1.47 MB
File Count
21
NPM Version
8.5.5
Node Version
16.15.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
npm install element-china-area-data -S
1import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
服务端用法:
1const { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } = require('element-china-area-data/dist/app.commonjs')
provinceAndCityData
是省市二级联动数据(不带“全部”选项)regionData
是省市区三级联动数据(不带“全部”选项)provinceAndCityDataPlus
是省市区三级联动数据(带“全部”选项)regionDataPlus
是省市区三级联动数据(带“全部”选项)""
CodeToText
是个大对象,属性是区域码,属性值是汉字 用法例如:CodeToText['110000']
输出北京市
TextToCode
是个大对象,属性是汉字,属性值是区域码 用法例如:TextToCode['北京市'].code
输出110000
,TextToCode['北京市']['市辖区'].code
输出110100
,TextToCode['北京市']['市辖区']['朝阳区'].code
输出110105
省市二级联动(不带“全部”选项):
1<template> 2 <div id="app"> 3 <el-cascader 4 size="large" 5 :options="options" 6 v-model="selectedOptions" 7 @change="handleChange"> 8 </el-cascader> 9 </div> 10</template> 11 12<script> 13 import { provinceAndCityData } from 'element-china-area-data' 14 export default { 15 data () { 16 return { 17 options: provinceAndCityData, 18 selectedOptions: [] 19 } 20 }, 21 22 methods: { 23 handleChange (value) { 24 console.log(value) 25 } 26 } 27 } 28</script>
省市二级联动(带“全部”选项):
1<template> 2 <div id="app"> 3 <el-cascader 4 size="large" 5 :options="options" 6 v-model="selectedOptions" 7 @change="handleChange"> 8 </el-cascader> 9 </div> 10</template> 11 12<script> 13 import { provinceAndCityDataPlus } from 'element-china-area-data' 14 export default { 15 data () { 16 return { 17 options: provinceAndCityDataPlus, 18 selectedOptions: [] 19 } 20 }, 21 22 methods: { 23 handleChange (value) { 24 console.log(value) 25 } 26 } 27 } 28</script>
省市区三级联动(不带“全部”选项)
1<template> 2 <div id="app"> 3 <el-cascader 4 size="large" 5 :options="options" 6 v-model="selectedOptions" 7 @change="handleChange"> 8 </el-cascader> 9 </div> 10</template> 11 12<script> 13 import { regionData } from 'element-china-area-data' 14 export default { 15 data () { 16 return { 17 options: regionData, 18 selectedOptions: [] 19 } 20 }, 21 22 methods: { 23 handleChange (value) { 24 console.log(value) 25 } 26 } 27 } 28</script>
1<template> 2 <div id="app"> 3 <el-cascader 4 size="large" 5 :options="options" 6 v-model="selectedOptions" 7 @change="handleChange"> 8 </el-cascader> 9 </div> 10</template> 11 12<script> 13 import { regionDataPlus } from 'element-china-area-data' 14 export default { 15 data () { 16 return { 17 options: regionDataPlus, 18 selectedOptions: [] 19 } 20 }, 21 22 methods: { 23 handleChange (value) { 24 console.log(value) 25 } 26 } 27 } 28</script>
value是区域码"110000"
npm run dev
是开发
npm run build
+ npm run build-commonjs
+ npm run docs
是准备发布
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More