vant地区三级联动

     <van-cell-group>             <!--cell+popup+area省市区的坑-->             <van-cell v-model="carmodel"  value @click="shows = true"></van-cell>             <van-popup v-model="shows" position="bottom">               <van-area                 ref="area"                 value="110000"                 :area-list="areaList"                 @change="onChange"                 @confirm="shows = false"                 @cancel="shows = false"               />             </van-popup>           </van-cell-group>   import { Cell, CellGroup, Popup, Field,  Area, Picker } from 'vant'  data() {     return { shows: false,       areaList,       carmodel: "省/市/区",     };   },        methods: {     onChange(picker, value, index) {       console.log("当前值:" + value + "当前索引:" + index);
      let areaName = "";       for (var i = 0; i < value.length; i++) {         areaName = areaName + value[i].name + " ";       }       this.carmodel = areaName;     },
  },
上一篇:微信小程序中使用vant


下一篇:Vue 利用Vant组件实现数据的上拉刷新,下拉加载