dwb-city

city

Usage no npm install needed!

<script type="module">
  import dwbCity from 'https://cdn.skypack.dev/dwb-city';
</script>

README

Dwb-City

Install

npm i dwb-city --save

Mount

mount with global

import Vue from 'vue'
import City from 'dwb-city'

Vue.use(City)

mount with component

import { dwbCity } from 'dwb-city'

export default {
  components: {
    dwbCity
  }
}

Use

<dwb-city v-model="show"
      :data="cityData"
      :city="city"
      ref="city"
      @change="getData"/>
data () {
  return {
    cityData: [CITY JSON], // 省市区json 不传默认引入
    show: [True/False],
    city: [110000, 110100, 110112]
  }
}
// set Data Method or
this.$refs.city.setCurr(this.city)

Example

npm install

npm run dev

[Dwb City]

Author

[Dengwb]