标签:style back round sage ati var 时间 div orm
实例如下:
<div id="app"> {{ time | formatTime}} </div> <script> new Vue({ el: "#app", data: { time: ‘12345643‘ }, filters: { //对时间戳进行格式化 formatTime: function(value){ var unixTimestamp = new Date( value*1000 ); var D = new Date(unixTimestamp); var H = D.getHours()>9 ? D.getHours() : "0"+D.getHours(), M = D.getMinutes()>9 ? D.getMinutes() : "0"+D.getMinutes(); return H + ":" + M } } }) </script>
标签:style back round sage ati var 时间 div orm
原文地址:http://www.cnblogs.com/garfieldzhong/p/6723746.html