美文网首页
2020-06-02elementUI开始日期结束日期禁用

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

作者: ClarkM | 来源:发表于2020-06-02 11:41 被阅读0次
            <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>

    相关文章

      网友评论

          本文标题:2020-06-02elementUI开始日期结束日期禁用

          本文链接:https://www.haomeiwen.com/subject/vzfuzhtx.html