2016-12-01 143 views
0

我不知道如何在Jade文件中使用if &。如何在Jade中使用if&else

我:

br 
        each test in changes 
         .change-row 
          if test.property == "Image" 
          strong #{test.property} 
          else{ 
          strong #{test.property} 
          span : #{test.newValue} 
          } 

回答

1

你必须从别的除去大括号和正确缩进代码。

br 
each test in changes 
    .change-row 
    if test.property == "Image" 
     strong #{test.property} 
    else 
     strong #{test.property} 
     span : #{test.newValue} 

了解更多信息

http://learnjade.com/tour/conditionals/