el-date-picker 的使用问题-自学留用,change事件好用
<el-date-picker
v-model="queryFromToDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
@change="fromToDateChange"
>
</el-date-picker>
qeryFromToDate: undefined,
query: {
Kssj: undefined,
Jssj: undefined
}
fromToDateChange(newValue) {
if (newValue) {
this.query.Kssj = newValue[0];
this.query.Jssj = newValue[1];
} else {
this.query.Kssj = undefined;
this.query.Jssj = undefined;
}
},