How do I insert html tags in JS with pug?

前端 未结 1 909
南笙
南笙 2021-01-22 12:03

When I need to use a JSON-like object in JS with different data in each block and iterating through that object I make a HTML code via pug.

Let me describe it in code<

1条回答
  •  礼貌的吻别
    2021-01-22 12:22

    You can write the html tags as usually something like:

    text: "wake up and some teeth"

    Then in pug you can use unescaped attributes like this:

    .some-class!=footerMenu.left[0].text
    

    or using string interpolation attributes unescaped

    .some-class !{footerMenu.left[0].text}
    

    0 讨论(0)
提交回复
热议问题