1. 在组件中添加picker-options属性;官方说明:当前时间日期选择器特有的选项

          <el-date-picker
            v-model="addForm.date"
            placeholder="请选择使用日期"
            type="date"
            value-format="yyyy-MM-dd"
            :picker-options="expireTimeOption"
          />

  

2. 在data函数中return对应的特有的选项expireTimeOption;

      expireTimeOption: {
        disabledDate(date) {
          // 当天可选:date.getTime() < Date.now() - 24 * 60 * 60 * 1000
          return date.getTime() < Date.now()
        }
      }

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-12-12
  • 2022-12-23
  • 2022-01-23
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案