Iview DatePicker 限制选择当前月份及以后的月份

iview DatePicker之前月份禁用且下月可用

iview date

html代码

<DatePicker type="month" :options="options4" :value="dialogForm.estimatedStartTimeWithCreate" @on-change="monthTime($event, 'loadDateStart')" placeholder="请选择时间" class="itemMonth" style="width: 210px"></DatePicker>

js代码

data() {
    return {
    dialogForm: {
        estimatedStartTimeWithCreate: '', // 绑定的日期值
      },
		options4: {
	        disabledDate(date) {
	          const disabledDay = new Date()
	          return date && date.valueOf() < disabledDay.setMonth(disabledDay.getMonth() - 1)
	        }
      }
   }
},
methods: {
	monthTime(val) {
      console.log('monthTime:', val)
      this.dialogForm.estimatedStartTimeWithCreate = val
    }
}

到此这篇关于Iview DatePicker 仅允许选择当前月份及以后的月份的文章就介绍到这了,更多相关Iview DatePicker仅允许选择当前月份内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

来源链接:https://www.jb51.net/javascript/330895o3b.htm

© 版权声明
THE END
支持一下吧
点赞10 分享
评论 抢沙发
头像
请文明发言!
提交
头像

昵称

取消
昵称表情代码快捷回复

    暂无评论内容