联系官方销售客服
1835022288
028-61286886
导航循环如何判断是当前栏目就输出 style="display: flex;",不是当前栏目就输出 style="display: none;"
{category module=share pid=0} <li class="{if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} active{/if}"> <a class="font-bold" href="{$t.url}" title="{$t.name}" {if $t.tid==2} target="_blank"{/if}>{$t.name}</a> {if $t.child} <ol class="x-head-nav-second none" style="display: flex;" > {category module=share pid=$t.id return=t2} <li class="{if $t2.child} dropdown-submenu{/if} {if IS_SHARE && $catid && dr_in_array($catid, $t2.catids)} active{/if}"> <a class="flex" href="{$t2.url}"> </a> </li> {/category} {/if} </ol> {/category}
这个就是 ,你把display 包裹在里面就行了