Skip to main content

Module components_showcase

Module components_showcase 

Source
Expand description

项目自写组件的公开图鉴与独立用法页。

目录、文案和属性说明来自本模块的静态数据;预览直接渲染项目里的组件。

Modules§

browser_previews 🔒
图鉴中的浏览器实例。每个预览拥有独立 DOM 宿主,正式页面与这里复用同一 JS 库。
business_previews 🔒
Local examples for business components. The production controllers stay in components/.
comment_previews 🔒
评论组件图鉴:固定样例与局部上下文,展示节点仍由正式评论组件渲染。
layout_article_previews 🔒
文章组件的本地样例。所有展示复用正式组件,演示操作仅改本地状态。
live_previews 🔒
图鉴里的实时预览:直接渲染生产 UI 组件,状态只留在本页,不发任何请求。

Structs§

AlertBoxDemoProps 🔒
Props for the AlertBoxDemo component.
CodeToken 🔒
ComponentPreviewProps 🔒
Props for the ComponentPreview component.
ComponentSpec 🔒
GetShowcaseData 🔒
Serialized arguments for the get_showcase_data server function.
ShowcaseData 🔒
ShowcaseDataGateProps 🔒
Props for the ShowcaseDataGate component.
ShowcaseDetailProps 🔒
Props for the ShowcaseDetail component.
ShowcaseDetailRoute
单枚组件详情路由,对应 /about/components/:component。
ShowcaseGalleryProps 🔒
Props for the ShowcaseGallery component.
ShowcaseInspectorProps 🔒
Props for the ShowcaseInspector component.
ShowcaseRoute
组件图鉴目录路由,对应 /about/components。

Enums§

PreviewMode 🔒
PreviewRoute 🔒
UsageKind 🔒

Constants§

DETAIL_SECTIONS 🔒
详情页的章节,与右侧目录一一对应。
MASONRY_PRELOAD_SCRIPT 🔒
首屏边解析边排瀑布流:卡片一闭合就按自然高度写好 grid-row-end,浏览器每次中途绘制 看到的都是最终位置;之后由 showcase-masonry.ts 接管(公式、断点与它一致,算出的跨度 相同,不再挪动)。卡片的位置只取决于它前面卡片的跨度,所以还在解析的最后一张不用等。 客户端导航时脚本在目录挂上文档时执行,此时卡片已齐,一次排完。

Statics§

SHOWCASE 🔒

Functions§

AlertBoxDemo 🔒
Required Props
ComponentPreview 🔒
Required Props
ShowcaseDataGate 🔒
加载图鉴数据后再渲染子页面,使目录、详情与预览可同步读取 showcase()。
ShowcaseDetail 🔒
Required Props
ShowcaseGallery 🔒
ShowcaseInspector 🔒
目录右侧的详情栏:说明、状态、属性与用法,并给出详情页入口。
__ShowcaseDetailRoute_View 🔒
__ShowcaseRoute_View 🔒
alert_box_next_variant 🔒
alert_box_preset_message 🔒
alert_box_snippet 🔒
checkbox_snippet 🔒
checkbox_state 🔒
click_hits_interactive 🔒
点击是否落在卡片内的交互控件上(链接、按钮、编辑器等),这类点击不触发卡片选中。
fetch_showcase 🔒
客户端会话内只请求一次;首屏直接复用 SSR 水合数据。取数函数随分包加载, 见 hooks::ssr_resource。
get_showcase_data 🔒
group_label 🔒
highlight_snippet 🔒
highlighted_view 🔒
高亮后的用法片段。
inspector_visible 🔒
宽屏时目录右侧有详情栏,点卡片只切换选中;窄屏没有详情栏,点卡片直接进入详情页。
is_local_demo 🔒
is_wide_preview 🔒
preview_route 🔒
showcase 🔒
当前图鉴数据。