如下filters如何调用method中的padDate并且传值呢?
filters: {
formatDate: function(value) { let _this = this; let date = new Date(value); let year = date.getFullYear(); let month = padDate(date.getMonth()+1); let day = padDate(date.getDate()); let hour = padDate(date.getHours()); let minutes = padDate(date.getMinutes()); let seconds = padDate(date.getSeconds()); return year +'-'+month +'-'+day+''+hour+':'+minutes+':'+seconds; }
},
methods: {
padDate(value){ return value <10?'0'+value :value; }
}
qq_笑_17
沧海一幻觉
相关分类