(), // 获取当前日期 }; }, }; </script> <style scoped> /* 禁用导航到其他月份的按钮 */ .custom-calendar .el-calendar-header__btn.prev, .custom-calendar .el-calendar-header__btn.next { pointer-events: none; /* 禁止点击事件 */ opacity: 0.5; /* 可选:降低按钮的...
handleMonthChange(val) { // 获取当前时间月份 let month = timeFormate(1); // 如果时间一致,则默认当前日期 if (val === month) { this.calendarDate = new Date(); this.$emit("get-date-result", timeFormate(2)); } else { // 否则默认每个月第一天 this.calendarDate = new Date(val); ...
<template><el-date-pickerv-model="monthValue"type="month"format="yyyy-MM"value-format="yyyy-MM":picker-options="pickerOptions"placeholder="选择月份"@change="changeMonth"></el-date-picker>{{ year }}年{{ month > 9 ? month : `0${month}` }}月<el-tooltipclass="item"effect="dark"cont...