<table>
<thead>
<tr>
<th>日期</th>
</tr>
</thead>
<tbody :style="{'max-Height':maxHeight}">
<tr v-for="(item, index) in stateData" :key="index">
<td>{{dateFormatFull(item.st_date)}}</td>
</tr>
</tbody>
</table>
stateData:[
{
st_date:'1612800000000',
},
]
methods: {
dateFormatFull(longTypeDate) {
var dateType = "";
var date = new Date();
date.setTime(longTypeDate);
dateType = date.getFullYear() + "-" + this.getFullPart(date.getMonth() + 1) + "-" + this.getFullPart(date.getDate());
//精确到分
dateType = date.getFullYear() + "-" + this.getFullPart(date.getMonth() + 1) + "-" + this.getFullPart(date.getDate()) + " " + this.getFullPart(date.getHours()) + ":" + this.getFullPart(date.getMinutes());
return dateType;
},
getFullPart(day) {
return day < 10 ? "0" + day : day;
},
}