//默认根据月份显示当前月的第一天和最后一天
<el-date-picker
v-model="geMonth"
type="month"
placeholder="请选择账期"
format="yyyy-MM"
value-format="yyyy-MM"
@change="getMyDateTime()"
></el-date-picker>
getMyDateTime() {
const now = new Date(this.geMonth);
const nowMonth = now.getMonth();
const nowYear = now.getFullYear();
const monthStartDate = new Date(nowYear, nowMonth, 1);
const monthEndDate = new Date(nowYear, nowMonth + 1, 0);
this.startTime2 = monthStartDate.getFullYear() + '-' + (monthStartDate.getMonth() + 1) + '-' + monthStartDate.getDate()
this.endTime2 = monthEndDate.getFullYear() + '-' + (monthEndDate.getMonth() + 1) + '-' + monthEndDate.getDate()
}
以上是编程学习网小编为您介绍的“el-date-picker时间插件,根据月份显示当前月的第一”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。
织梦狗教程
本文标题为:el-date-picker时间插件,根据月份显示当前月的第一


基础教程推荐
猜你喜欢
- ASP.NET登出系统并清除Cookie 2024-03-09
- 用js判断用户浏览器是否是XP SP2的IE6 2023-12-01
- js树插件zTree获取所有选中节点数据的方法 2023-12-22
- jQuery Validate表单验证插件实现代码 2023-12-29
- Ajax 跨域如何实现 2022-12-28
- 基于jquery实现的可编辑下拉框实现代码 2024-02-04
- vue-router中hash模式与history模式的区别 2024-01-29
- 用JS做的简单的可折叠的两级树形菜单 2023-12-20
- 2.(for循环)计算1+3+5+...+99的和(html) 2023-10-26
- 洛克王国法老王怎么得_法老王在哪抓_法老王获得方法图文攻略 2024-01-23