problem description
vue v-for takes a timestamp, then adds a filter, and becomes a NaN-NaN-NaN, without a filter, which can be displayed normally. What is the reason for this
the environmental background of the problems and what methods you have tried
v-for ws.craeateTime 13formatDate
related codes
/ / Please paste the code text below (do not replace the code with pictures)
<div v-for=" ws in wmessage" class="wmessageBoxTop">
<div class="wmessageBoxTopleft"></div>
<ul class="wmessageBoxTopright">
<li></li>
<li class="wmessageBoxTopTime">
<div>{{ws.createTime | formatDate}}
>>>
</div>
</li>
</ul>
</div>
selector
filters: {
formatDate: function (value) {
var date = new Date(value);//10*1000131000
var Y = date.getFullYear() + "-";
var M = (date.getMonth()+1 < 10 ? "0"+(date.getMonth()+1) : date.getMonth()+1) + "-";
var D = date.getDate() + " ";
var h = date.getHours() + ":";
var m = date.getMinutes() + ":";
var s = date.getSeconds();
return Y+M+D+h+m+s;
}
},
what result do you expect? What is the error message actually seen?