<template><div id="app"><el-form :model="form"><el-form-item label="预签时间"><el-date-picker v-model="form.t2" type="date" placeholder="选择预签时间" @change='preSigning'/></el-form-item><el-form-item label="预计招标时间"><el-date-picker v-model="form.t1" type="date" placeholder="选择预计招标时间" :picker-options="pickerOptions"/></el-form-item></el-form>{{JSON.stringify(form,null,2)}}</div>
</template><script>
import dayjs from 'dayjs'
export default {name: 'App',data(){return {pickerOptions: {disabledDate: (time) => {return time.getTime() < new Date(this.form.t1).getTime();}},form:{t1:'',t2:''}}},methods:{preSigning(time){const t = dayjs(time).add(1,'month').format('YYYY-MM-DD hh:mm:ss');console.log(dayjs(time).format('YYYY-MM-DD hh:mm:ss'),'time');console.log(t,'t');this.form.t1 = t;}}
}
</script>