필터

1129 단어 vue.js



    
    
    
    Document
    


    
{ {currentTime|filterTime}}
var em = new Vue({ el: "#ssl", data: { currentTime: new Date(), // }, filters: { filterTime(val) { var Y = val.getFullYear() var M = val.getMonth() var D = val.getDate() var H = val.getHours() var MI = val.getMinutes() var S = val.getSeconds() return Y + " " + M + " " + D + " " + H + " " + MI + " " + S + " " } }, // data created() { var _this = this; // Vue this, setInterval(function () { _this.currentTime = new Date()// }, 1000); } })

좋은 웹페이지 즐겨찾기