area-selection
v1.0.1
Published
area select
Downloads
6
Readme
Install
Using npm:
npm install area-selection --save
import AreaSelect from 'area-selection';
Vue.component(AreaSelect.name,AreaSelect);
## Usage
```vue
<template>
<areaSelect ref="area" @on-change="addressAreaChange" :province="provinceInfo" :city="cityInfo" :county="countyInfo"
:level="2"></areaSelect>
</template>
<script>
export default {
data () {
return {
provinceInfo: {},
cityInfo: {},
countyInfo: {}
}
},
methods: {
addressAreaChange(value, level){
level === 0 ? this.provinceInfo = value : '';
level === 1 ? this.cityInfo = value : '';
level === 2 ? this.countyInfo = value : '';
}
}
}
</script>