原文地址:《Vue系列》timeago.js将时间戳转换成“几天前”“几分钟前”等格式 | 理木客www.limuke.top
![18d5e177ff13ac520538b3a2258b55a7.png](https://img-blog.csdnimg.cn/img_convert/18d5e177ff13ac520538b3a2258b55a7.png)
1、引入timeago.js>1.引入timeago.js
/**
2.在vue分过滤器中定义changeTime方法
filters
3.在template中使用,例如:
time是需要转换的时间戳,changeTime是过滤器中定义的方法
<
原文地址:《Vue系列》timeago.js将时间戳转换成“几天前”“几分钟前”等格式 | 理木客www.limuke.top
/**
filters
time是需要转换的时间戳,changeTime是过滤器中定义的方法
<