// 方法引用
createTime:‘20210422193807’
<span class="line-height-32">{{ timeFormatter(createTime) }}</span>
········时间返回: '20210422193807' ====>
················最后得到: '2021-04-22 19:38:07'
// 时间截取方法:
timeFormatter(cellValue) {
return `${cellValue.slice(0, 4)}-${cellValue.slice(4, 6)}-${cellValue.slice(6, 8)} ${cellValue.slice(8, 10)}:${cellValue.slice(10, 12)}:${cellValue.slice(12, 14)}`;
},
// 时间截取:
createTime:‘1678350978000 ’
<span v-if="createTime" v-date-format="createTime" />
········返回时间(时间戳):‘ 1678350978000 ’
···············最后得到: ' 2023-3-9 16:36:18 '
网友评论