diff --git a/src/components/master-detail/index.vue b/src/components/master-detail/index.vue index 0dc6ad9..7c96427 100644 --- a/src/components/master-detail/index.vue +++ b/src/components/master-detail/index.vue @@ -126,7 +126,17 @@ const rootStyle = computed(() => ({ -webkit-overflow-scrolling: touch; // 时长和曲线都来自 page-layout.less 的变量,列表页导航栏用同一组, // 两边必须同拍,否则列表跳、导航滑。 - transition: left @duration @easing, right @duration @easing, opacity .12s ease-out; + transition: + left @duration @easing, + right @duration @easing, + border-color .2s linear, + opacity .12s ease-out; + } + + // 常驻一条透明分隔线:谁在左谁负责显示,换人的时候不改变盒宽 + .master, + .detail { + border-right: 1px solid transparent; } // 未选中:主栏占满,另外两层收在右侧边界外 @@ -167,7 +177,7 @@ const rootStyle = computed(() => ({ .master { right: calc(100% - var(--tui-master-width)); - border-right: 1px solid var(--td-component-border, rgba(0, 0, 0, .08)); + border-right-color: var(--td-component-border, rgba(0, 0, 0, .08)); } .detail, @@ -188,10 +198,6 @@ const rootStyle = computed(() => ({ */ &.is-collapsed { - .master { - border-right-color: transparent; - } - .detail, .sub { overflow-y: hidden; @@ -207,14 +213,17 @@ const rootStyle = computed(() => ({ */ &.has-sub { + // 分隔线跟着换人:列表在视口外,主栏与右栏之间改由详情画 .master { left: calc(-1 * var(--tui-master-width)); right: 100%; + border-right-color: transparent; } .detail { left: 0; right: calc(100% - var(--tui-master-width)); + border-right-color: var(--td-component-border, rgba(0, 0, 0, .08)); } .sub {