<el-col :span="8" style="height:28px"> <el-form-item label="领取截止时间:" required label-width="130px"> <el-form-item prop="ReceiveUpTime"> <el-date-picker v-model="model.ReceiveUpTime" type="date" placeholder="选择日期" :picker-options="checkTime(model.EndTime,model.ReceiveUpTime)" value-format="yyyy-MM-dd" style="100%"></el-date-picker> </el-form-item> </el-form-item> </el-col> checkTime: function (Starttime, Validtime) { if (Starttime && Validtime) { if (Starttime > Validtime) { this.$message.warning("领取截止时间不能小于结束日期"); } } },
网上其它写法不起作用,所以用了上面的方法,其它常用写法参考:
https://www.cnblogs.com/IwishIcould/p/12594400.html