/vue-distpicker

A simple Vue component for picking provinces, cities and districts of China.

Primary LanguageVue

vue-distpicker

NPM version NPM downloads CircleCI codecov

A simple Vue component for picking provinces, cities and districts of China.

Install

yarn add vue-distpicker

CDN: UNPKG | jsDelivr (available as window.Distpicker)

Usage

<template>
  <distpicker></distpicker>
</template>

<script>
import Distpicker from 'vue-distpicker'

export default {
  components: {
    Distpicker
  }
}
</script>

API

Name Type Description
ids Array 默认传入省市区的 id
change Function 返回选择的省市区数据包含 id 以及 name
prov String 省份选择框 name 值
city String 城市选择框 name 值
dist String 地区选择框 name 值
prov-placeholder String 省份选择框 placeholder 值
city-placeholder String 城市选择框 placeholder 值
dist-placeholder String 地区选择框 placeholder 值

License

MIT © sinchang