全局配置:
Vue.prototype.formatDateTime = function(te) {
if(te == '') {
return ''
} else {
var time = new Date(te);
var dateTime = time.getTime() / 1000;
return dateTime;
}
}
使用:vm.formatDateTime(xxxx);
全局配置:
Vue.prototype.formatDateTime = function(te) {
if(te == '') {
return ''
} else {
var time = new Date(te);
var dateTime = time.getTime() / 1000;
return dateTime;
}
}
使用:vm.formatDateTime(xxxx);
转载于:https://my.oschina.net/u/3946362/blog/2054761