elementUI,设置日期,只能选择今天和今天以后的, :picker-options="pickerOptions"

1. html 加 :picker-options="pickerOptions"
<el-date-picker
  v-model="shop.receive_time[0]"
  type="date"
  size="small"
  format="yyyy-MM-dd"
  value-format="yyyy-MM-dd"
  :picker-options="pickerOptions"
  @change="startTime(shop.seller_id, shop.receive_time)"
  placeholder="选择交货开始日期">
</el-date-picker>
2. data里加
pickerOptions: { // 限制收货时间不让选择今天以前的
  disabledDate(time) {
    return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
  }
}
 
posted @ 2019-07-11 14:09  曾经的水哥  阅读(18579)  评论(0编辑  收藏  举报