V - Distpicker
是一个简单、易用、灵活的 Vue
组件,且兼容 PC 端、移动端。
安装
yarn add v-distpicker --save
注册组件
注册全局组件
import VDistpicker from 'v-distpicker'
Vue.component('v-distpicker', VDistpicker);
注册组件
import VDistpicker from 'v-distpicker'
export default {
components: { VDistpicker }
}
简单使用
<el-form-item label="所属地区" prop="">
<VDistpicker
:province="diglogForm.province"
:city="diglogForm.city"
:area="diglogForm.area"
@province="onChangeProvince"
@city="onChangeCity"
@area="onChangeArea"
></VDistpicker>
</el-form-item>
//数据
diglogForm: {
province: null,
city: null,
area: null,
}
//事件
onChangeProvince(data) {
this.diglogForm.province = data.value;
},
onChangeCity(data) {
this.diglogForm.city = data.value;
},
onChangeArea(data) {
this.diglogForm.area = data.value;
}