Element-ui时间选择器禁止选择当月之后的月份
文章目录
html
<el-date-picker
v-model="fixValue"
type="month"
class="fl"
value-format="yyyy-MM"
clearable
size="mini"
placeholder="选择日期"
:picker-options="endDatePicker"
>
</el-date-picker>data数据定义
data(){
return{
endDatePicker: this.handelFixDate(),
fixValue:null
}
},methods:
handelFixDate() {
console.log(this.fixValue, "132");
let self = this;
return {
disabledDate(time) {
let t = new Date().getDate();
// 如果想包含本月本月 - 8.64e7 * t 就不需要了,
// 如果想之前的不能选择把 > 换成 <
return time.getTime() > Date.now() - 8.64e7 * t;
},
};
},————————————————
版权声明:本文为CSDN博主「__不靠谱先生」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_...

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论