<van-field label-width="60px" v-model="form.native" label="国籍:" />
<van-field label-width="60px" readonly clickable @click="birthdayShow = true" v-model="form.birthday" label="出生年月:" />
<van-field label-width="60px" v-model="form.poloutlock" label="政治面貌:" />
<van-calendar v-model="birthdayShow" color='#00CA9D' @confirm="onConfirmDate" />
onConfirmDate(data){
this.birthdayShow = false;
console.log('日期',data)
this.form.birthday = `${this.formatDate(data)}`
console.log('日期字符串',this.form.birthday)
},
formatDate(now){
let year = now.getFullYear();
let month = now.getMonth() +1;
let date = now.getDate();
return year + '-' + month + '-'+date
}

image.png
网友评论