1、接口返回时间戳
2、表格展示
3、表格绑定:formatter="formatTime"
<el-table-column
property="updateTime"
label="更新时间"
width="200"
align="center"
:formatter="formatTime"
/>
4、安装引入momentjs并进行时间转换
import moment from "moment/moment";
const formatTime = (_row: any, _columnIndex: any, cellValue: number) => {
try {
return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");
} catch (err: any) {
console.error(err);
return "-";
}
};