我正在尝试将按钮添加为 Pug 表中的行元素。 但按钮没有插入到特定行 以下是哈巴狗代码
table
tr#headtag
th DishName
th Quantity
th Currently_Done
th Predicted
th
each order in orders
tr
th=order.dish.name
th=order.numberOfQuantity
th=order.dish.predictedValue
th=order.dish.predictedValue
th=button(class="btn btn-small", type="button") Slett
在浏览器中收到“某些内容失败错误”
没有按钮代码工作正常。
table
tr#headtag
th DishName
th Quantity
th Currently_Done
th Predicted
each order in orders
tr
th=order.dish.name
th=order.numberOfQuantity
th=order.dish.predictedValue
th=order.dish.predictedValue
最佳答案
删除 button
和 之前的
(可选) > 并尝试以下操作:=
,class
和 type
之间的
th
button(class="btn btn-small" type="button") Slett
来自docs :
Buffered code starts with
=
. It evaluates the JavaScript expression and outputs the result. For security, buffered code is first HTML escaped.
因此 th=button(class="btn btn-small", type="button") Slett
不起作用。
关于node.js - 按钮未插入 Pug 中的表格行内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53130922/