vue默认显示当前日期
<el-form-item label="开始日期"><el-date-pickerv-model="startdates"style="width: 120px"type="date"value-format="yyyy-MM-dd"placeholder="选择日期"></el-date-picker>...
<el-form-item label="开始日期">
<el-date-picker v-model="startdates" style="width: 120px" type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期" >
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker v-model="enddates" style="width: 120px" type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期 >
</el-date-picker>
</el-form-item>
return:{
startdates: "",
enddates: "",
}
methods:{
//获取当前日期
date() {
var time = new Date();
var day = ("0" + time.getDate()).slice(-2);
var month = ("0" + (time.getMonth() + 1)).slice(-2);
var today = time.getFullYear() + "-" + month + "-" + day;
return today;
},
}
更多推荐
所有评论(0)