How do I put a html tag conditional in jade?

后端 未结 7 717
逝去的感伤
逝去的感伤 2021-02-01 17:27

In jade, I want to put in a html tag conditional as per this method, which puts in




        
7条回答
  •  执笔经年
    2021-02-01 17:54

    Starting at version 1.0.0, the // if construct is not magical anymore. Either render HTML verbatim (any line starting with < is transmitted as-is by Jade) or use a mixin, as per Tom's blog cited in another answer:

    mixin ie(condition)
        | 
    
    doctype html
    html
      head
        title= My title
        +ie('if IE 8')
          link(rel='stylesheet', href='/stylesheets/style-ie8-1.css')
    

提交回复
热议问题