PUG:如何在pug中的另一个对象内显示JSON对象的元素

我正在尝试使用以下Pug布局显示一组数据:

  table(class='table')
    thead(class='thead-dark')
      tr
        th Message
        th From
        th Class
        th Text
        th Sent
      tbody
      each message in message_list
        tr
          td #{message.message_type}
          td #{message.from_attendee}
          td
            a(href='/classes/'+message.for_class) #{message.for_class}
          td #{message.full_message}
          td #{message.string_time_sent}

现在,message.from_attendee是对已从数据库填充的对象的引用,因此在上面的示例中显示

{"classes":[],"_id":"5db1c4e58c49732f54c41ec9","first_name":"Paul","last_name":"T","phone":"","email":"","active":"active","__v":0}

我想要实现的是在哈巴狗中引用message.from_attendee.first_name。阅读一些帖子,但它们似乎无济于事。

xiaoruyuango 回答:PUG:如何在pug中的另一个对象内显示JSON对象的元素

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3163581.html

大家都在问