feat: master-detail third pane

- MasterDetail / MasterDetailPage: add `sub` prop and `#sub` slot. The three
  columns share one container and are placed by left/right, so the detail pane
  moves between columns without remounting and keeps its scroll position.
- useMasterDetailPane: add subView / openSub / closeSub, keep the sub view in
  query and browser history alongside detail and view.
- page-layout: sub pane reuses the in-pane navbar rules; the list navbar slides
  out on the third level instead of being hidden.
- docs: demos for the third pane, the layered navbars and PaneTransition;
  restore transition durations in demo previews under prefers-reduced-motion,
  where VitePress zeroes them. Fix the missing `split` ref in the master-detail
  demo and the incorrect note about the back arrow.
This commit is contained in:
Timi
2026-11-11 23:55:30 +08:00
parent 81bbbc0662
commit ba0c7bf9a2
14 changed files with 1185 additions and 85 deletions
+9
View File
@@ -59,6 +59,7 @@ const splitList: Array<{ value: boolean | "auto"; text: string }> = [
{ value: false, text: "强制单栏" }
];
const split = ref<boolean | "auto">("auto");
const selectedId = ref("c1");
const current = computed(() => customerList.find(item => item.id === selectedId.value));
</script>
@@ -89,10 +90,18 @@ const current = computed(() => customerList.find(item => item.id === selectedId.
.frame {
height: 320px;
position: relative;
overflow: hidden;
border-radius: .75rem;
border: 1px solid var(--td-component-border);
background: var(--td-bg-color-page);
// 组件自带 tui-page-content,真实页面里它绝对定位铺满内容区,
// demo 里补上同样的定位上下文,否则两栏没有高度可分配
:deep(.tui-master-detail-page) {
inset: 0;
position: absolute;
}
}
.list {