A flexible, highly available district selector for picking provinces, cities and districts of China.
Here is documents
npm install v-distpicker --save
Or
yarn add v-distpicker --save
Register component
Registe global component:
import Distpicker from 'v-distpicker'
Vue.component('v-distpicker', Distpicker)
Registe component:
import VDistpicker from 'v-distpicker'
export default {
components: { VDistpicker }
}
How to use
Basic:
<v-distpicker></v-distpicker>
Default Value:
<v-distpicker province="广东省" city="广州市" area="海珠区"></v-distpicker>
Mobile:
<v-distpicker type="mobile"></v-distpicker>
QuickPassCity:
<!-- 如果是直辖市,则快速跳过市的选择,直接进入区的选择 -->
<v-distpicker quick-pass-city></v-distpicker>
Sort Province, City, Area:
<v-distpicker :sort-province="provinceSort" :sort-city="citySort" :sort-area="areaSort"></v-distpicker>
export default {
methods: {
provinceSort(provinceX, provinceY) {
//shoul return 1, 0 or -1
},
citySort(province, cityX, cityY) {
//shoul return 1, 0 or -1
},
areaSort(province, city, areaX, areaY) {
//shoul return 1, 0 or -1
},
},
}
The plugin is open-sourced software licensed under the MIT license.