Skip to main content

Module frontend_layout

Module frontend_layout 

Source
Expand description

前台布局组件(header + footer + 路由骨架屏切换)。 前台布局组件

包裹所有前台路由,提供统一的 Header、Footer 与主内容区容器, 并为不同路由在 Suspense 中展示对应的骨架屏。

布局在主包里只构建一次(Leptos 组件体只运行一次),随路由变化的部分 (导航激活项、主区宽度、站点分享信息)跟随当前显示的页面 (use_rendered_route),骨架屏按地址栏指向的目标页选择。

Structs§

FrontendLayoutProps
Props for the FrontendLayout component.
FrontendShellProps 🔒
Props for the FrontendShell component.

Enums§

SkeletonKind 🔒
路径对应的骨架屏种类。

Functions§

FrontendLayout
前台整体布局组件。
FrontendShell 🔒
前台页面与图鉴样例共用的布局关系;路由内容由外层提供。
main_width_class 🔒
路径对应的主区宽度类:文章页 1240px(680px 正文 + 右侧目录),图鉴 1152px,其余与页头同宽。
pending_target 🔒
懒加载分包挂起期间要占位的前台目标路径。
route_error_fallback 🔒
路由内容渲染出错时按错误类型兜底,不解析展示文本。
route_skeleton 🔒
布局 Suspense 兜底:标签页与图鉴立即显示,其余延迟 200ms(见 DelayedSkeleton)。
skeleton_kind 🔒
按路径(use_location().pathname,不含查询串)选择骨架屏种类。
skeleton_view 🔒
路径对应的骨架屏,立即渲染。