早睡早起
<template>
<div class="bindingBank">
<div v-if="cityPopupVisible" @click="cityPopupVisible = false" class="picBox">
<mt-picker style="width: 100%" :slots="citySlots" value-key="text" showToolbar ref="picker" @change="cityPopuphandleConfim">
<span>取消</span>
<span @click="backPickerSubBtn">确认</span>
</mt-picker>
</div>
</div>
</template>
<script>
import list from '../../api/name'
import cityData from '../../api/city'
import { Checklist } from 'mint-ui';
export default {
data() {
return {
cityPopupVisible: false,
citySlots: [ { flex: 1, values: [], className: 'slot1', textAlign: 'right' },
{ divider: true, content: '-', className: 'slot2' },
{ flex: 1, values: [], className: 'slot3', textAlign: 'left' } ],
city: null,
num: 1,
chooseMonth: null,
chooseDate: null,
}
},
mounted() {
this.backSlots[0].values = this.list;
this.citySlots[0].values = cityData.provList;
this.citySlots[2].values = cityData.cityMap["北京"]
this.chooseMonth = cityData.provList[0].text;
this.chooseDate = cityData.cityMap["北京"][0].text;
},
methods: {
cityPopuphandleConfim(picker, values) {
picker.setSlotValues(1, cityData.cityMap[values[0]]);
this.chooseMonth = values[0];
this.chooseDate = values[1].text;
console.log(this.chooseMonth + ","+this.chooseDate)
},
},
}
</script>
<style lang="less" scoped>
</style>
在最后附上我的QQ: 2489757828 有问题的话可以找我一同探讨
我的私人博客: 李大玄