Expand description
抽屉:手机上的导航与目录面板。底部抽屉样式见 shell.css 的 .sheet,
左侧抽屉(后台导航)见 admin.css 的 .side-sheet。
Structs§
- Bottom
Sheet Props - Props for the
BottomSheetcomponent. - Sheet
Close - 抽屉内容用来关闭抽屉(带退出动画、焦点还给触发按钮)。
- Side
Sheet Props - Props for the
SideSheetcomponent.
Constants§
- DRAG_
CLOSE_ 🔒DISTANCE - 向下拖过该距离松手即关闭。
- DRAG_
DEAD_ 🔒ZONE - 拖拽死区:手指移动超过 4px 才开始跟手,避免轻点误拖。
- SHEET_
EXIT_ 🔒MS - 关闭动画时长(ms),与 shell.css 的
sheet-out一致。 - SIDE_
CLOSE_ 🔒DISTANCE - 左侧抽屉向左拖过该距离松手即关闭。
Functions§
- Bottom
Sheet - 底部抽屉。
- Side
Sheet - 左侧抽屉。
- drag_
offset 🔒 - 拖拽位移:死区内为 0,向上拖不跟手(抽屉已贴底)。
- focus_
selectors 🔒 - 聚焦第一个能匹配到的选择器(仅 wasm)。
- lock_
page_ 🔒scroll - 打开期间锁住页面滚动(与底部抽屉共用
html.sheet-open)。 - side_
drag_ 🔒offset - 左侧抽屉的拖拽位移(≤ 0):只认向左、且水平位移大于竖直位移的拖动(竖直方向留给
抽屉内滚动),并减去 4px 死区。返回
None表示这次按下还不算拖拽。 - use_
sheet_ close - 在
BottomSheet/SideSheet的子组件里取得关闭句柄。 - use_
sheet_ 🔒lifecycle - 两种抽屉共用的开合生命周期,返回
(closing, close):