更新时间:2023-12-01 08:08:04
小胡子不会为您呈现内容.您的函数接受一个参数lastLoginAt
,但Mustache将为您传递另一个参数:render
.用lastLoginAt
调用render
将扩展变量:
Mustache won't render the contents for you. Your function takes one argument, lastLoginAt
, but Mustache will pass you another: render
. Calling render
with lastLoginAt
will expand the variable:
formatLastLoginAt: function () {
return function (lastLoginAt, render) {
lastLoginAt = render(lastLoginAt); // expand variable
return moment (lastLoginAt).format ('Do MMMM YYYY');
}
}