没有订单的玉模板渲染标签

时间:2012-03-02 10:46:00

标签: node.js pug

我有这个jade文件:

- if (transactions != undefined)
    table
        th Site Name
        th Deadline
        th Delete Transaction

        each item in transactions
            tr
                td= item.item_name
                td
                    span(id='countdown'+item.timeout)= item.timeout
                td
                    span(style='cursor: pointer;', onclick='deleteTransaction('+item.uniqueId+')')= "X"

        button(id='confirmButton', onclick='confirm();', value="Confirm", name="Confirm")= "Confirm"

我的问题很简单:在渲染所有这些内容时,jade编译器会在表格顶部呈现按钮,我希望在显示表格后呈现它。我再一次搜索了文档,但我找不到任何有趣的东西。有人能帮助我吗?

由于

1 个答案:

答案 0 :(得分:1)

您的缩进使button位于table内。它“向右”向左一步,你应该没事:

- if (transactions != undefined)
    table
        th Site Name
        th Deadline
        th Delete Transaction

        each item in transactions
            tr
                td= item.item_name
                td
                    span(id='countdown'+item.timeout)= item.timeout
                td
                    span(style='cursor: pointer;', onclick='deleteTransaction('+item.uniqueId+')')= "X"

    button(id='confirmButton', onclick='confirm();', value="Confirm", name="Confirm")= "Confirm"