How does one add a conditional inside of a link in jade?

后端 未结 1 1329
抹茶落季
抹茶落季 2021-01-05 06:12

How does one add a conditional inside of a tag (link/anchor in my case) in jade?

Here\'s my pseudo code that of course won\'t work:

a(href=\"/foo\",          


        
相关标签:
1条回答
  • 2021-01-05 07:02

    How about

    a(href="/foo", class=(current_route[1] === 'foo')? "active" : "") Go to Foo

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