element-ui 日期组件最大日期和最小日期限制
element-ui 日期组件最大日期和最小日期
1 2 3 4 5 6 7 8 9 10 11 12
| <el-date-picker v-model="transactionDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00','23:59:59']" :picker-options="isDisabled" > </el-date-picker>
|
设置最大选择日期和最小选择日期
1 2 3 4 5 6 7 8 9 10
| isDisabled: { disabledDate(time) { let myDate = new Date(); let _beforeDay = myDate.setDate(new Date().getDate() - 1); return time.getTime() >= _beforeDay; return time.getTime() < new Date('2019/07/25 00:00:00').getTime() - 8.64e7; } },
|