VUE如何修改时间格式

<el-table-column> 列中加上属性项:formatter=FunctionName

<el-table-column
          align="center"
           prop="createdOn"
           :formatter="formatTime"
           label="申請日期">
  </el-table-column>

2 methods中编写formatTime函数

formatTime(row, column) {
        const date = new Date(row[column.property])
        return date.getFullYear() + '年' +
         date.getMonth() + '月' +
         date.getDate() + '日 ' +          
         date.getHours() 
         + ':' +date.getMinutes()
    },

  

原文地址:https://www.cnblogs.com/shanshuiYiCheng/p/14102620.html