|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
- <van-cell :title="title" :value="value" :label="label" :icon="icon" :url="url" :border="border" :required="required" @click="show=true">
|
|
|
+ <van-cell :title="title" :value="value" :label="label" :icon="icon" :url="url" :border="border" :required="required" @click="openDate()">
|
|
|
{{ date_value }}
|
|
|
<template slot="right-icon">
|
|
|
<van-icon name="underway-o" class="blue iconBox" />
|
|
|
</template>
|
|
|
- <van-calendar v-model="show" @confirm="onConfirm" :min-date="minDate1" :max-date="maxDate1" color="#238dfa" :get-container="getContainer" />
|
|
|
+ <van-calendar ref="calender" v-model="show" @confirm="onConfirm" :min-date="minDate1" :max-date="maxDate1" color="#238dfa" :get-container="getContainer" />
|
|
|
</van-cell>
|
|
|
</template>
|
|
|
|
|
@@ -74,8 +74,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
show: false,
|
|
|
- minDate1: new Date(2010, 0, 1),
|
|
|
- maxDate1: new Date(2050, 0, 1),
|
|
|
+ minDate1:new Date(2010, 0, 1),
|
|
|
+ maxDate1:new Date(2050, 0, 1),
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -85,16 +85,16 @@ export default {
|
|
|
onConfirm(data) {
|
|
|
this.show = false;
|
|
|
this.$emit('value', this.$moment(data).format('YYYY-MM-DD'));
|
|
|
+ },
|
|
|
+ openDate(){
|
|
|
+ this.minDate1=this.minDate;
|
|
|
+ this.maxDate1=this.maxDate;
|
|
|
+ this.show=true;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.show=true;
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- show(val){
|
|
|
- if(val){
|
|
|
- this.minDate1=this.minDate;
|
|
|
- this.maxDate1=this.maxDate;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
};
|
|
|
</script>
|
|
|
|