在一個循環中,我需要將div
在第一個循環之後隱藏起來,並將其隱藏起來,並在展開時顯示,簡單正確。如何禁用剃刀與打開和關閉標籤的聰明?
//above this lives code that draws a product section
if (product.DisplayOrder == 1 && Model.Count > 1)
{
<div class="arrow-with-text" style="cursor: pointer;">
<div class="arrow-right"></div>
<div class="arrow-down" style="display: none"></div>
<div style="margin-left: 2em;margin-top: -1.3em;font-size: 1.2em;color: #2280c4;">Other available Wills…</div>
</div>
<div class="other-wills" style="display: none">
}
else (product.DisplayOrder == Model.Count)
{
</div>
}
我的預期是什麼先被包裹在other-wills
格,然後在最後一個被關閉之後去的所有部分。它實際得到的是這個。
<div class="arrow-with-text" style="cursor: pointer;">
<div class="arrow-right"></div>
<div class="arrow-down" style="display: none"></div>
<div style="margin-left: 2em;margin-top: -1.3em;font-size: 1.2em;color: #2280c4;">Other available Wills…</div>
</div>
<div class="other-wills" style="display: none">
}
else (product.DisplayOrder == Model.Count)
{
</div>
<div class="sections-wrapper">
這不正是我所期待的(它reendered }else product.DisplayOrder == Model.Count){
文本)。
如何使剃鬚刀解釋我if
聲明的關閉和else
是否正確?
試圖'@ else'和'@ if'? –