npm i dwb-city --save
import Vue from 'vue'
import City from 'dwb-city'
Vue.use(City)
import { dwbCity } from 'dwb-city'
export default {
components: {
dwbCity
}
}
<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)
npm install
npm run dev