JS部分
<script>
import request from '@/api/request'
export default {
name: 'BlogManage',
filters: {
formatDate(time) {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth()
let day = date.getDate()
let hour = date.getHours()
let min = date.getMinutes()
let second = date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + second
}
},
}
</script>
<el-table
v-loading="listLoading"
:data="blogList"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">
{{ scope.row.createDate | formatDate}}
</template>
</el-table-column>
</el-table>
|