header-menu.ts
页头导航项。
config/header-menu.ts 按数组顺序配置页头导航。每一项都是一个导航对象,其中 label 必填。模板自带的页头组件会读取 label、pathname、hash、description、external 和 hidden。
导航项对象
badge
模板自带的页头组件不显示 badge。
visibility
模板自带的页头组件不读取 visibility。如需按角色或能力控制导航项是否显示,需要自行修改导航组件。
match
模板自带的页头组件不读取 match,而是直接根据 pathname 判断当前页面:首页采用完全匹配,其他路径同时匹配自身和下级页面。
children
子导航项数组,其中每一项仍使用相同的导航对象,也可以继续嵌套。模板自带的页头组件不显示子导航。
meta
附加数据,类型为 Record<string, unknown>。模板自带的页头组件不读取此字段。
模板默认导航项
| 顺序 | label.value | label.key | pathname | hash | description.value |
|---|---|---|---|---|---|
| 1 | Home | components.header.nav.home | / | — | Return to the homepage. |
| 2 | Docs | components.header.nav.docs | /docs | — | Learn how to configure and extend the application. |
| 3 | Pricing | components.header.nav.pricing | / | #pricing | Compare monthly and yearly subscription plans. |
| 4 | FAQs | components.header.nav.faqs | / | #faqs | frequently asked questions |
数组顺序就是页头中的显示顺序。pathname 与 hash 同时填写时,会跳转到指定页面中的对应锚点。