<template> <div class="app-container"> <el-date-picker v-model="filters.column.create_start_date" type="date" :picker-options="pickerBeginDateBefore" format="yyyy-MM-dd" placeholder="开始日期"> </el-date-picker> <el-date-picker v-model="filters.column.create_end_date" type="date" format="yyyy-MM-dd" :picker-options="pickerBeginDateAfter" placeholder="结束日期"> </el-date-picker> </div> </template>
<script> export default { data() { return { filters: { column: { create_start_date: ‘‘, create_end_date: ‘‘ }, }, pickerBeginDateBefore: { disabledDate: (time) => { let beginDateVal = this.filters.column.create_end_date; if (beginDateVal) { return time.getTime() > beginDateVal; } } }, pickerBeginDateAfter: { disabledDate: (time) => { let beginDateVal = this.filters.column.create_start_date; if (beginDateVal) { return time.getTime() < beginDateVal; } } } } } } </script>
原文地址:https://www.cnblogs.com/lxy1123/p/9026168.html
时间: 2024-11-01 15:14:11