首页 > Web开发 > 详细

vue-elemnet-ui日期选择器添加状态

时间:2021-06-17 21:32:11      阅读:20      评论:0      收藏:0      [点我收藏+]

通过 Picker Options 属性双向绑定 :picker-options="pickerOptions"

pickerOptions:{

//参数disabledDate 参数 设置禁用状态

//下面禁用了当前及当前以后的日期

disabledDate: time => {

let nowDate = new Date();

if (nowDate.getFullYear() == time.getFullYear() && nowDate.getMonth() == time.getMonth() && nowDate.getDate() == time.getDate()) return true

return time.getTime() > nowDate.getTime();   },  

//    cellClassName: date => { } 給特定的日期添加样式

cellClassName: date => {

根据条件返回相应的样式类

 

if(date)return ‘样式类 ‘ } 

}

注意:样式类在vue项目中 必须写在

<style lang="scss"></style>中

vue-elemnet-ui日期选择器添加状态

原文:https://www.cnblogs.com/Natural-numbers/p/14895791.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!