1. @vant/area-data
Vant 省市区数据
@vant/area-data
Package: @vant/area-data
Created by: vant-ui
Last modified: Fri, 27 Oct 2023 14:16:30 GMT
Version: 1.5.1
License: MIT
Downloads: 7,448
Repository: https://github.com/vant-ui/vant

Install

npm install @vant/area-data
yarn add @vant/area-data

Vant China Area Data

中国省市区数据,适用于 Vant 的 Area 和 Cascader 等组件。

安装

 # 通过 npm
npm i @vant/area-data

# 通过 yarn
yarn add @vant/area-data

# 通过 pnpm
pnpm add @vant/area-data

# 通过 Bun
bun add @vant/area-data

使用

在 Vant 的 Area 组件中使用时,直接引用 areaList 对象即可:

 import { areaList } from '@vant/area-data';

在 Vant 的 Cascader 组件中使用时,请使用 useCascaderAreaData 方法:

 import { useCascaderAreaData } from '@vant/area-data';

const cascaderAreaData = useCascaderAreaData();

数据更新

中国的行政区划每年都会有变动,如果发现省市区数据未及时更新,欢迎提 Pull Request 帮助我们更新。你可以在「国家统计局 - 全国区划代码」「民政部 - 行政区划代码」上查询到最新数据,请根据官方数据进行核实。

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin