跳到內容

Pagination (am-pagination)

am-pagination 提供 SSR 友善的分頁導覽,包含 previous / next 與 condensed page list。

  • 需要 currentPagetotalPages
  • getPageHref(page) 用來建立 link
  • 目前是 link-based pagination,不處理 client-side data fetching state
<Pagination
currentPage={6}
totalPages={12}
getPageHref={(page) => `/articles?page=${page}`}
/>

詳見 playground /playground/navigation/ 範例。