vue.js渲染时间戳

来源:互联网 发布:怎么学软件 编辑:程序博客网 时间:2024/05/08 06:31

在使用vuejs框架的页面上显示时间,

方法: 引入强大的插件commentjs,下载地址下载

页面上添加的代码 

 Vue.filter('moment', function (value, formatString) {        formatString = formatString || 'HH:mm:ss';        return moment(value).format(formatString);    }); 

然后渲染的方法: 使用moment

 <td class="text-center">{{item.time | moment}}</td>


原创粉丝点击