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
@@ -206,7 +206,7 @@ onUnmounted(() => {
}
// VitePress 会在 reduced-motion 环境把所有 transition-duration 设为 0。
// 文档预览中的 PageTransition 用于验证组件转场,因此在预览范围内恢复原定时长。
// 文档预览里的过渡组件就是用来验证转场的,因此在预览范围内恢复原定时长。
@media (prefers-reduced-motion: reduce) {
.tui-demo {
:deep(.page-transition .push-left-enter-active) {
@@ -223,6 +223,42 @@ onUnmounted(() => {
:deep(.page-transition .fade-leave-active) {
transition-duration: 200ms !important;
}
// PaneTransition:栏内推入/推出
:deep(.tui-pane-forward-enter-active),
:deep(.tui-pane-forward-leave-active) {
transition-duration: 420ms, 200ms !important;
}
:deep(.tui-pane-back-enter-active) {
transition-duration: 420ms !important;
}
:deep(.tui-pane-back-leave-active) {
transition-duration: 420ms, 300ms !important;
}
// MasterDetail:三列的 left/right 位移与收起时的淡出
:deep(.tui-master-detail.split .master),
:deep(.tui-master-detail.split .detail),
:deep(.tui-master-detail.split .sub) {
transition-duration: 320ms, 320ms, 120ms !important;
}
// 分栏时列表页导航栏跟着主栏宽度走
:deep(.tui-page-layout > .t-navbar--fixed .t-navbar__content) {
transition-duration: 320ms, 320ms, 120ms !important;
}
// v-entrance-transition 的入场;栏内那一档是 200ms
:deep(.entrance-fade-up-enter-active) {
transition-duration: 400ms !important;
}
:deep(.tui-master-detail .detail .entrance-fade-up-enter-active),
:deep(.tui-master-detail .sub .entrance-fade-up-enter-active) {
transition-duration: 200ms !important;
}
}
}
</style>