Closed haizhilin2013 closed 7 years ago
项目中需要用到不少过滤器,比如时间,货币等。。。看到nunjucks本身是支持的,要怎么结合进来呢?
var nunjucks = require('nunjucks'); var env = new nunjucks.Environment(); env.addFilter('shorten', function(str, count) { return str.slice(0, count || 5); });
开了个分支完美支持nunjuck,https://github.com/xiongwilee/koa-grace/tree/nunjucks
nunjucks 要添加个过滤器怎么加呢?