el-date-picker月选择器获取选择的日期范围
<el-date-picker
v-model="monthValue"
type="month"
placeholder="选择月"
value-format="yyyy-MM-dd"
@change="monthChange"
>
</el-date-picker>
monthChange(val) {
const [year, month, day] = val.split('-') // 获取对应的年月日
const endDate = new Date(year, month, 0).getDate() // 获取对应的年所在月有多少天
let res = [`${year}-${month}-${day}`, `${year}-${month}-${endDate}`]
console.log(res)
},
标签:picker,el,month,year,date,选择器
From: https://www.cnblogs.com/ProgrammerMao-001/p/18342762