我正在使用Jade和Express,我想在我的include语句中使用一个变量。例如:在Jade中使用变量包括
app.js
app.get('/admin', function (req, res) {
var Admin = require('./routes/admin/app').Admin;
res.render(Admin.view, {
title: 'Admin',
page: 'admin'
});
});
layout.jade
- var templates = page + '/templates/'
include templates
当我这样做,我得到EBADF, Bad file descriptor 'templates.jade'
我甚至尝试
include #{templates}
错误无济于事。
我一直在寻找这个问题,以及。惊讶这个功能尚未添加。分叉回购看看实现这个功能是多么困难。 –