Skip to main content

item_active

Function item_active 

Source
fn item_active(
    nav_items: Signal<Vec<NavItemConfig>>,
    label: &'static str,
) -> Signal<bool>
Expand description

某个栏目(按 label 区分)当前是否处于激活状态。

栏目列表本身固定,随路径变化的只有激活态;各栏目元素按 label 保持同一个 DOM 节点, 激活态原地切换(aria-current 与 .nav-indicator 胶囊),与转场脚本测量胶囊的方式一致。