0


Element UI中设置日期格式

  • 第一步:为el-date-picker添加属性value-format=“yyyy-MM-dd”,意思是当前的时间绑定值得格式为yyyy-MM-dd,format=“yyyy-MM-dd” 可以添加也不添加
  • 第二步:添加@change=“getBirthDate”,并自定义事件
  • 具体代码:
  • <el-date-picker type="date" placeholder="选择生日" v-model="addUserForm.birth" style="width: 100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="getBirthDate"> </el-date-picker>`````` getBirthDate (date) { this.addUserForm.birth = date }

本文转载自: https://blog.csdn.net/weixin_70024734/article/details/131940656
版权归原作者 隔壁的程序员大表哥 所有, 如有侵权,请联系我们删除。

“Element UI中设置日期格式”的评论:

还没有评论