后台返回的时间数据时,有时候为时间戳的格式,一种方法是在后台直接进行时间格式转换成我们前端想要的数据形式
还有一种方法就是前端我们自己进行时间数据格式的转换
下面我们就介绍在前端vue直接进行时间转换的方法
<template slot-scope="scope">
<span>{{ parseTime(scope.row.t) }}</span>
</template>
<template slot-scope="scope">
<span>{{ scope.row.login_t == 0 ? "":parseTime(scope.row.login_t) }}</span>
</template>原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。