<el-date-picker type="date" default-value='1990-1-1' placeholder="选择日期" v-model="birth" style="width:100%"></el-date-picker>

vue中真正获取后的birth的值的格式为:Thu May 12 2016 08:00:00 GMT+0800 (中国标准时间)

获取自己想要的格式:

birthStr=birth.getFullYear() + '-' + (birth.getMonth() + 1) + '-' + birth.getDate() + ' ' + birth.getHours() + ':' + birth.getMinutes() + ':' + birth.getSeconds();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2021-12-04
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-02-09
相关资源
相似解决方案