以下帕格腳本:else塊中的縮進是否從當前塊繼續?
- data = [ "A", "B", "C", "D" ]
- for (i=0,i<data.length;i++)
- var even = (i%2)==0
if even
.row
.col #{data[i]}
else
.col #{data[i]}
生產:
<div class="row">
<div class="col">A</div>
</div>
<div class="col">B</div>
<div class="row">
<div class="col">C</div>
</div>
<div class="col">D</div>
我要的是:
<div class="row">
<div class="col">A</div>
<div class="col">B</div>
</div>
<div class="row">
<div class="col">C</div>
<div class="col">D</div>
</div>
爲什麼在else塊縮進不遵守?我如何實現我想要的輸出?