码迷,mamicode.com
首页 > 其他好文 > 详细

elementUI 日期 周一、周二、周三、周四、周五、周六、周日快捷键

时间:2018-06-12 11:22:28      阅读:906      评论:0      收藏:0      [点我收藏+]

标签:tar   lld   model   快捷   option   message   UI   sage   ace   

<el-date-picker
v-model="ruleForm.pickDateMeal"
type="daterange"
align="right"
:range-separator="$t(‘message.To‘)"
:start-placeholder="$t(‘message.Start_date‘)"
:end-placeholder="$t(‘message.End_date‘)"
@change="getDateHandler"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
:picker-options="pickerOptions2"
:default-value="defalutDate"
>
</el-date-picker>

pickerOptions2: {
shortcuts: [{
text: ‘星期一‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 1, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期二‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 2, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期三‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 3, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期四‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 4, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期五‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 5, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期六‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 6, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘星期日‘,
onClick (picker) {
const end = new Date()
const start = new Date()
_this.getDaysMonday(start, 90, 2, 0, _this.allDays)
picker.$emit(‘pick‘, [start, end])
}
}, {
text: ‘今天‘,
onClick (picker) {
picker.$emit(‘pick‘, new Date())
}
}
],
// 设置选择今天以及今天之后的日期
disabledDate (time) {
return time.getTime() < Date.now() - 8.64e7
}
}

elementUI 日期 周一、周二、周三、周四、周五、周六、周日快捷键

标签:tar   lld   model   快捷   option   message   UI   sage   ace   

原文地址:https://www.cnblogs.com/langqq/p/9172078.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!