侧栏收拢时导航按钮跟着缩窄;配置区高度折叠动画;侧栏不再牵动页面内容

导航按钮宽度写死 159px 而不是 100%,百分比到像素之间没法插值,收拢时
按钮平滑缩成 36px 的方形贴住图标,高亮块不再被裁切出血。配置表单和
链式代理段的出现消失改成高度折叠(量出目标高度做插值,margin 换成
padding 否则那一截在动画之外瞬跳)。路由页「新增」按钮的文字不再跟着
侧栏密度隐藏:侧栏收拢是侧栏自己的事。
This commit is contained in:
2026-08-11 16:42:43 +08:00
parent 5a04968e17
commit 0ddefd0d5d
3 changed files with 56 additions and 5 deletions
+14 -1
View File
@@ -244,7 +244,8 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
}
.nav-item {
width: 100%;
/* 写死而不是 100%:百分比到像素之间没法插值,宽度动画会直接跳变 */
width: 159px;
display: flex;
align-items: center;
gap: var(--s-3);
@@ -256,6 +257,18 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
cursor: pointer;
text-align: left;
white-space: nowrap;
overflow: hidden;
/* width 跟侧栏同节奏,颜色沿用全局的 0.15s;transition 不叠加,这里要写全 */
transition:
width 0.3s ease,
color 0.15s ease,
background-color 0.15s ease,
border-color 0.15s ease;
}
/* 收拢后按钮缩成正方形贴着图标,高亮块不再被裁切:8 + 18 + 8 加两侧边框 = 36 */
.is-compact .nav-item {
width: 36px;
}
.nav-item:hover {