<el-form-item label="开始时间" prop="startTime">
        <el-date-picker
              v-model="dataForm.startTime"
              type="date"       
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              placeholder="选择日期"
              :picker-options="pickerOptionsStart"
            >
            </el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
        <el-date-picker
             v-model="dataForm.endTime"
             type="date"
             format="yyyy-MM-dd"
             value-format="yyyy-MM-dd"
             placeholder="选择日期"
             :picker-options="pickerOptionsEnd"
        >
        </el-date-picker>
</el-form-item>
 data () {
      return {
        dataForm: {
          startTime:'',
          endTime:''
        },
       
        pickerOptionsStart: {
           disabledDate: time => {
             let endDateVal = this.dataForm.endTime;
             if (endDateVal) {
                return time.getTime() > new Date(endDateVal).getTime();
             }
           }
        },
        pickerOptionsEnd: {
           disabledDate: time => {
             let beginDateVal = this.dataForm.startTime;
             if (beginDateVal) {
               return (time.getTime()<new Date(beginDateVal).getTime()-1*24*60*60*1000
             );
           }
        }
    }
		
   }
},

 

GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45 7 个月前
a07f3a59 * Update transition.md * Update table.md * Update transition.md * Update table.md * Update transition.md * Update table.md * Update table.md * Update transition.md * Update popover.md 7 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐