pub(super) fn PostsTabs(_: PostsTabsProps) -> ElementExpand description
文章管理 tab 栏:「全部文章」与「回收站」。
tab 状态由父组件传入的 active signal 驱动(非路由),点击即调用 on_change
切换。回收站 tab 带 trash_count 数量角标,便于发现待清理文章。
底部带平滑滑动指示器(绝对定位的滑块 + transition),切换 tab 时滑块从 一个 tab 平滑滑到另一个,与 FilterTabs(system/comments 页)视觉一致。滑块 位置通过 WASM 端测量目标 button 的 offsetLeft/offsetWidth 动态计算。
两个 tab 均用 inline-flex items-center 同盒模型,外层容器加 items-center,
根除原先「全部文章」(inline 文本) 与「回收站」(inline-flex 带角标) 盒模型
不一致导致的垂直错位。
§Props
For details, see the props struct definition.
active:Signal<PostsTab>trash_count:Signal<Option<i64>>on_change:EventHandler<PostsTab>