el-date-picker只能选择今天

<el-form-item :prop="BeginDate" :rules="formContentRules.BeginDate" style="width:150px;float:left;margin-right:10px;">
                            <el-date-picker  v-model="BeginDate"
                                            type="date" value-format="yyyy-MM-dd" placeholder="选择日期" size="mini" style="width:150px;"
                                            :picker-options=pickerBeginOption>
                            </el-date-picker>
pickerBeginOption: {
                        disabledDate: (time) => {                                                        
                            //只能选择今天
                            return time.getTime() < new Date().getTime() - 1 * 24 * 60 * 60 * 1000 || time.getTime() > new Date().getTime() ;
                        }
                    }

 

posted @ 2020-11-11 17:48  算盘  阅读(516)  评论(0编辑  收藏  举报