ydcss / vue-ydui

A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
http://vue.ydui.org
MIT License
2.75k stars 560 forks source link

谢谢作者的分享,虽然您很久没更新了,还是想请教一下yd-datetime标签的start-date和end-date的问题 #763

Open xiebo22 opened 5 years ago

xiebo22 commented 5 years ago

问题描述

作者是个菜鸟,请详细地描述问题,不要一句话带过(特别是将描述放在标题上的),根据情况贴上代码

处理 issue 是件很耗精力的事,请提交 issue 前考虑一下是否把问题说清楚了

产生环境

提示错误信息

  1. Invalid prop: custom validator check failed for prop "startDate".
  2. Invalid prop: custom validator check failed for prop "endDate".
  3. Invalid prop: custom validator check failed for prop "value".

    代码区域

    <script>
    当属性start-date end-date 不为固定字符串时(由于业务原因时间无法写死所以是动态生成的时间段)控制中心会抛错(如上错误信息),虽然功能不会收到影响,但是确实抛错了。请问具体是什么原因呢?
    </script>
whooog commented 4 years ago

我也遇到了这个问题,报错的原因是因为月份没有加判断格式不对 加上这句代码就不会报错了:month = month < 10 ? '0' + month : month;