【发布时间】:2016-09-16 02:40:02
【问题描述】:
我正在尝试在 pug 模板中动态创建元素。
我使用基本命令从数据库中检索信息
db.component.findAll().then(function(component){
res.render('stock' ,{ table:component})
})
内容应该被创建的模板是
.tbl-content
table(cellpadding='0', cellspacing='0', border='0')
tbody
- row in table
tr
td= "#{row.name}"
td= "#{row.storage}"
我检查了语法,它应该是正确的,但结果完全错误。它将row in table 作为字符串,例如内容并显示在页面上,与"#{row.name}" 和"#{row.storage}" 相同
是我使用了一些过时的语法还是我的方法完全错误?
谢谢!
【问题讨论】: