Skip to main content

Module home

Module home 

Source
Expand description

首页模块。

对应路由:

  • /:首页,默认展示第 1 页文章。
  • /page/:page:分页首页,展示指定页码的已发布文章列表。

数据获取:通过 use_server_future 调用 list_published_posts server function, 从服务端获取已发布文章的分页列表与总数,并渲染文章卡片与分页导航。 在 wasm32 目标下,server function 的函数体被替换为向服务端端点发起 HTTP POST 请求的客户端存根; 实际的数据库访问逻辑仅在 feature = "server" 启用时运行。

Re-exports§

pub use Home_completions::Component::Home;
pub use HomePage_completions::Component::HomePage;

Structs§

HomePageProps
Properties for the HomePage component.
HomePostsProps 🔒
Properties for the HomePosts component.

Constants§

POSTS_PER_PAGE 🔒

Functions§

Home
首页组件,对应路由 /
HomeInfo 🔒
首页头部信息组件,展示站点名称与副标题。
HomePage
首页分页组件,对应路由 /page/:page
HomePosts 🔒
首页文章列表与分页展示组件。