@urcloud/area-data
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Area Data

Convert Vant Area into Element UI Cascader Component data format.

Install

npm i @urcloud/area-data -D

Usage

Via commonjs

const getAreaTree = require('@urcloud/area-data').getAreaTree
const areaList = getAreaTree()

Via cdn

<script src="https://cdn.jsdelivr.net/npm/@urcloud/area-data/dist/index.umd.js"></script>
<script>
  const getAreaTree = AreaData.getAreaTree
  const areaList = getAreaTree()
</script>

Output

[
 {
    label:'北京市',
    value:'110000',
    children:[
      {
        label:'北京市',
        value:'110100',
        children:[
          {
            lable:'东城区',
            value:'110101'
          },
          ...
        ]
      },
      ...
    ]
  },
  ...
]

Methods

getAreaTree(addAll:boolean)

parameters:

  • addAll:false

Package Sidebar

Install

npm i @urcloud/area-data

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

273 kB

Total Files

15

Last publish

Collaborators

  • zenonux