vue时间格式与时间戳转换

HTML部分

<template slot-scope="scope">
                        {{dateFormat(scope.row.invoiceDate)}}
                    </template>

JS部分

dateFormat:function(timestamp){
                if(timestamp && timestamp !="")
                {
                    let dateStr = new Date(timestamp).Format("yyyy-MM-dd hh:mm:ss");
                    return dateStr;
                }
                return "-";
            },

评论

暂无评论