1. I want to deal with the time range plug-in. When my year is determined, my time range can only be selected within the year. I used the element time range plug-in, but I went to get the form data, but I couldn"t extract it. I tried to write dead data, but not dynamically
2,
html
< el-form-item label= "year" prop= "nf" >
<el-date-picker v-model="form.nf" :picker-options="pickerOptions1" type="year" placeholder="" format="yyyy"
value-format="yyyy" @change="startChange"></el-date-picker>
< / el-form-item >
< el-form-item label= "prop=" times >
<el-date-picker v-model="form.times" type="datetimerange" :picker-options="pickerOptions"
range-separator="" start-placeholder="" end-placeholder="" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" align="right">
</el-date-picker>
< / el-form-item >
3, data
data(){
return{
form:{
nf: new Date().getFullYear().toString(),
title: "",
beizhu: "",
sf: null,
bt: null,
times: [],
start_time: "",
end_time: ""
},
pickerOptions: {
disabledDate(time) {
console.log(this.form)
return (
Date.parse(this.form.nf+"/01/01") > time.getTime() ||
Date.parse(this.form.nf+"/12/31") < time.getTime()
);
}
},
}
}
now is the time for me to print this.form again and report an error, Cannot read property "form" of undefined, solve?