bulk-bar
列表页 通用列表页:标题、工具栏和行,桌面和移动端都适用。
选择模式下的顶部条,取代列表工具栏:计数、一个扩大选择的链接,以及操作菜单。
每个示例都能真实操作,但其中的链接不会跳转到任何地方。 HTML 显示可复制的标记。
选中了三行
破坏性的那一项放在最后:第一项才是外层表单按 Enter 时的隐含默认。
把这段放进 <div rst-list> 里。
<div rst-bulkbar >
<a rst-bulkbar-close href ="/posts" aria-label ="完成选择" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</a >
<span rst-bulkbar-selection ><span rst-bulkbar-count >已选 3 项</span ><a rst-bulkbar-escalate href ="/posts?select=all" >选择全部 412 条匹配项</a ></span >
<details rst-dropdown name ="rst-menus" >
<summary >
操作
<span rst-caret aria-hidden ="true" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="m6 9 6 6 6-6" /></svg >
</span >
</summary >
<div rst-dropdown-menu >
<button type ="submit" name ="action" value ="export" >导出</button >
<button type ="submit" name ="action" value ="unpublish" >取消发布</button >
<button type ="submit" name ="action" value ="delete" class ="rst-danger" >删除…</button >
</div >
</details >
</div >
在应用里,这会到达 /posts, /posts?select=all。在这里,它的链接和表单哪儿也不去。