日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

el-table-column 表單table的后端返回時(shí)間戳的轉(zhuǎn)換

作者:農(nóng)夫三拳有點(diǎn)疼=-= 更新時(shí)間: 2023-10-17 編程語(yǔ)言
<el-table-column prop="releaseDate" label="結(jié)算時(shí)間" align="left" :formatter="dateFormat">
</el-table-column>

方法
dateFormat(row, column,cellValue,index) {
      let date = new Date(parseInt(cellValue));
      if(isNaN(date)) return '--'
      let Y = date.getFullYear() + '-';
      let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';
      let D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
    /* let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
      let m = date.getMinutes()  < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
      let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();*/
      return Y + M + D ;/*+ h + m + s;*///不要 時(shí)分秒
    },

原文鏈接:https://blog.csdn.net/m0_64207574/article/details/130942668

  • 上一篇:沒(méi)有了
  • 下一篇:沒(méi)有了
欄目分類
最近更新