单选
<el-date-picker
v-model="value1"
type="date"
placeholder="选择日期"
value-format="yyyy.MM.dd"
@input="changeTime"
>
</el-date-picker>
// 日期选择
changeTime(e) {
console.log(e.replace(/\./g, "-"));
},
多选
<el-date-picker
v-model="value2"
type="daterange"
range-separator="至"
:start-placeholder="Begin"
:end-placeholder="Endtime"
value-format="yyyy.MM.dd"
@input="changeTime"
@change="pickerChangeFn"
>
</el-date-picker>
// 日期选择
changeTime(e) {
console.log(e);
const arrdata = e[0].replace(/\./g, "-");
const arrTime = e[1].replace(/\./g, "-");
this.ArraignedTime = arrdata + "至" + arrTime;
// console.log(arrdata, arrTime, "提审");
},
pickerChangeFn(e) {
// console.log(e, "0000000000000000000");
if (e == null) {
this.ArraignedTime = "";
}
},