Skip to main content

TagDetailContent

Function TagDetailContent 

Source
fn TagDetailContent(_: TagDetailContentProps) -> Element
Expand description

标签详情内容组件。

通过 use_server_future 调用 get_posts_by_tag 获取指定标签下的文章; 成功时渲染文章总数与文章卡片。

§反应式取数

post_detail.rs / home.rstag 是普通 String prop,被 moveuse_server_future 闭包后成为冻结快照,不建立反应式订阅。从标签云点击 切换标签(/tags/a → /tags/b,同为 Route::TagDetail 变体,复用组件实例) 时 future 不会重跑。修复:在闭包内通过 router().current::<Route>() 读取 当前 tag 建立订阅,路由变化即重跑。

§Props

For details, see the props struct definition.