2020-06-02elementUI开始日期结束日期禁用

2020-06-02  本文已影响0人  ClarkM
        <el-form-item label="开始日期">
          <el-col :span="12">
            <el-date-picker :clearable="false" :disabled="updateType === 'view'" :picker-options="{
                disabledDate: time => {
                  return time.getTime() > new Date(planElementMessageMap.endDate).getTime() - 8.64e7
                }
              }" @change="handlePickDate" align="center" format="yyyy-MM-dd" placeholder="开始日期" type="date"
              v-model="planElementMessageMap.beginDate" value-format="yyyy-MM-dd"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="结束日期">
          <el-col :span="12">
            <el-date-picker :clearable="false" :disabled="updateType === 'view'" :picker-options="{
                disabledDate: time => {
                  return time.getTime() < new Date(planElementMessageMap.beginDate).getTime() - 8.64e7
                }
              }" @change="handlePickDate" align="center" format="yyyy-MM-dd" placeholder="结束日期" type="date"
              v-model="planElementMessageMap.endDate" value-format="yyyy-MM-dd"></el-date-picker>
          </el-col>
        </el-form-item>
上一篇下一篇

猜你喜欢

热点阅读