1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > Vue - element 时间选择器设置禁用日期

Vue - element 时间选择器设置禁用日期

时间:2020-01-13 15:44:57

相关推荐

Vue - element 时间选择器设置禁用日期

element 地址:

/#/zh-CN/component/date-picker

组件中使用

<template><div><el-date-pickerv-model="value1"type="date"value-format="yyyy-MM-dd":picker-options="pickerOptions"></el-date-picker></div></template><script>export default {data() {return {value1: "",pickerOptions: {disabledDate(date) {// -07-11 至 -07-13 禁选,返回true代表禁用if (date.getTime() > new Date("-07-10") &&date.getTime() < new Date("-07-13")) {return true;}// 设置过去时间不可选,返回true代表禁用//let zero=new Date().setHours(0, 0, 0, 0);//if(date.getTime()<zero){// return true;//}return false;},},};},};</script><style scoped></style>

效果图:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。