我想抽象一些代码,并希望利用dust.helpers渲染一个parial。DustJS:渲染部分通过帮助器
我的当前设置:
{> "includes/components/link" /}
我理想设置:
{@uiComponent name="link" /}
我的助手:
dust.helpers.uiComponent = function (chunk, context, bodies, params) {
return dust.render('includes/components/' + name, context, function (err, out) {
chunk.end(out);
});
};
我也尝试了一些其他的东西,没有用。
是的,我试着看文档。 :(
任何建议,将不胜感激!
你要处理的部分以一种特殊的方式还是这只是抽象掉 – Interrobang
主要是抽象的文件路径的路径...但目前想拥有这个例如,如果需要,可以操纵数据。 – peduarte