使用相同的mixin功能显示多个标题

时间:2018-02-16 07:23:37

标签: html pug

我正在写一个pug文件,我试图用它们的标题垂直显示两个表。这两个表即将出现,但第二个表应该出现在第一个表之后。但它与第一​​个标题一起出现。

如附图所示,我希望待处理的调度应该在第一个表之后出现,但是它会出现在调度记录之下。

enter image description here

这是我的哈巴狗代码:

mixin dispatch-summary(message)
  h1.align-left.font-bold DISPATCH RECORD
  tr
    th.align-center.font-bold S.NO
    th.align-center.font-bold Dispatch Id
    th.align-center.font-bold Projects
    th.align-center.font-bold Hardware
    th.align-center.font-bold Box Number

    each task,status in message
      -var dispatch_id= task.dispatch_id
      -var project = task.project
      -var hardware = task.hardware
      -var boxnumber = task.boxnumber
      -var dispatched = task.dispatched

      if dispatched==true
        tr
          td.font-bold=status+1
          td.align-center= task.dispatch_id
          td.align-left.project= task.project
          td.align-left.hardware= task.hardware
          td.align-left.boxnumber= task.boxnumber

  h1.align-left.font-bold PENDING RECORD
  tr
    th.align-center.font-bold S.NO
    th.align-center.font-bold Dispatch Id
    th.align-center.font-bold Projects
    th.align-center.font-bold Hardware
    th.align-center.font-bold Box Number

    each task,status in message
      -var dispatch_id= task.dispatch_id
      -var project = task.project
      -var hardware = task.hardware
      -var boxnumber = task.boxnumber
      -var dispatched = task.dispatched

      if dispatched==false
        tr
          td.font-bold=status+1
          td.align-center= task.dispatch_id
          td.align-left.project= task.project
          td.align-left.hardware= task.hardware
          td.align-left.boxnumber= task.boxnumber
doctype
html
  head
  body
    div
      .divider-padded
      table.table.withbackground.width-100
        +dispatch-summary(message)

0 个答案:

没有答案