express-art-template
express-art-template copied to clipboard
在express-art-template如何使用dateformat方法进行日期的格式化?
我参考了art-template的写法,使用
const template = require('express-art-template'); const dateFormat = require('dateformat'); template.defaults.imports.dateFormat = dateFormat;
进行声明,但是会出现报错
TypeError: Cannot read property 'imports' of undefined
。
那么,有什么办法可以在模板中使用方法吗