SplitPane (分栏)

可拖动的两栏布局:宽度以 px 计、可吸附、可用键盘调整,按组件自身宽度折成一栏。

列表-详情

宽度以 px 计,由 v-model:size 控制,服务端渲染时就是这个宽度;要记住宽度,在 resize-end 里写 cookie,下次由服务端读回传给 size。snap-points 在拖到 8px 以内时吸附,中间的宽度仍然都能停。

《星空列车与白的旅行》通关感想

鲲 · 42 回复

拖动中间的分隔线调整左栏宽度,靠近 360 或 412 时会吸附过去,离开 8px 以上就能停在任意宽度。聚焦分隔线后可以用 左箭头 右箭头 微调,按住 Shift 一次走五步, Home / End 直接到最窄 / 最宽。

当前 360px · 上次保存 —

ListDetail.vue

主栏 + 辅助栏

千恋*万花

穗织是一座被山环绕的温泉小镇。主角有地将臣在帮忙整理神社时,意外拔出了供奉在那里的神刀「丛雨丸」, 从此被卷入与神刀之灵、巫女和小镇诅咒相关的一连串事件。

Aside.vue

按自身宽度折成一栏

stack-below 看的是组件自身的宽度(容器查询),不是窗口:放在侧栏旁边或另一栏里时,按实际可用的空间决定。

  • 《星空列车与白的旅行》通关感想
  • 求推荐和《白色相簿 2》气质相近的作品
  • 2026 年秋季新作发售表

窄于 48rem 时只显示一栏,分隔线也会隐藏。

Stacked.vue

属性

属性类型默认值说明
ariaLabelstringlocale splitPane.handleAccessible name of the divider.
maxSizenumber480Widest the primary pane can be dragged, in px.
minSizenumber240Narrowest the primary pane can be dragged, in px.
primary"start" | "end""start"Which pane `size` belongs to; the other takes the rest. `end` suits a main area with an auxiliary column on the right.
showPane"start" | "end""start"Which pane shows while stacked.
sizenumber360Width of the primary pane in px. Updated on every pointer move while dragging; persist from `resize-end`.
snapPointsnumber[][]Widths the divider is pulled to when it comes within `snapThreshold`, e.g. `[360, 412]`. Any width in between stays reachable.
snapThresholdnumber8How close, in px, the divider must come to a snap point to be pulled to it.
stackBelowfalse | "md" | "lg""md"Below this width of the component ITSELF (a container query, not the window), show one pane at a time: `md` is 48rem, `lg` 64rem. `false` keeps two panes at any width.
stepnumber10Arrow-key step in px; Shift moves five steps.

事件

事件回调参数说明
resize-endsize: numberA drag or a key press finished with this width — the one to persist.
update:sizevalue: number

插槽

插槽作用域说明
#endanyThe right pane.
#startanyThe left pane.