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 時,會前往指定頁面中的對應錨點。