控制台报错:

vue——使用moment将时间戳转换为日期显示为Invalid value问题

 

 

原因:后端返回的时间戳是字符串格式的

解决:将字符串转为数字即可 

<p class="time">{{!createTime?'':moment(Number(createTime)).format(formates)}}</p>

 

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-06-30
  • 2022-01-28
  • 2021-11-30
  • 2021-12-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案