【问题标题】:Button is not getting inserted inside table row in Pug按钮未插入 Pug 的表格行中
【发布时间】:2018-11-03 19:46:55
【问题描述】:

我正在尝试将按钮添加为 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

【问题讨论】:

    标签: node.js pug jade4j


    【解决方案1】:

    删除button 之前的=classtype 之间的,(可选),然后尝试以下操作:

    th
        button(class="btn btn-small" type="button") Slett
    

    来自docs

    缓冲代码以= 开头。它评估 JavaScript 表达式 并输出结果。为了安全起见,缓冲代码首先是 HTML 逃跑了。

    因此th=button(class="btn btn-small", type="button") Slett 不起作用。

    【讨论】:

    • 感谢您的回答和解释。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    • 2015-09-15
    • 2020-02-04
    • 1970-01-01
    相关资源
    最近更新 更多