Jade Inline Conditional

后端 未结 7 1602
你的背包
你的背包 2021-01-31 15:43

I\'m trying to make everything apart from the first element in an array have a CSS class using the Jade templating engine.

I was hoping I could do it like this, but no l

7条回答
  •  粉色の甜心
    2021-01-31 16:11

    With pug 2 you can use this syntax:

    a(href='/', class="link", class={"-active": page === 'home'}) Home page
    

    more here: https://pugjs.org/language/attributes.html

提交回复
热议问题