amis-theme: treegrid 左树高度跟随视口(.cxd-Tree max-height 视口相对)

amis .cxd-Tree--outline 默认 max-height:300px,treegrid 多级分类树「只露一半」、
下方大片留白。转换器给 treegrid 左树挂 className=eip4-treegrid-tree(见
TemplateToAmisConverter.convertTreeGrid),这里把该类内 .cxd-Tree max-height 抬到
calc(100vh-230px)+内部滚动——填满可用区域、超出树内滚(既非定高只露一半,
也非随内容无限撑高)。浏览器实证树高 615px、底部 783<视口 845。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-13 22:01:58 +08:00
parent d8232646f9
commit 693a8576ee

View File

@@ -302,3 +302,15 @@
justify-content: flex-end; justify-content: flex-end;
padding: 10px 0 4px; padding: 10px 0 4px;
} }
/* ============================================================================
9. TreeGrid 左树高度跟随视口
amis 的 .cxd-Tree--outline 默认 max-height:300px,多级分类树会「只露一半」、
下方大片留白。转换器给 treegrid 左树挂 className eip4-treegrid-tree
(见 TemplateToAmisConverter.convertTreeGrid),这里把其内树容器抬到视口相对
高度并内部滚动——填满可用区域、超出在树内滚(既非定高只露一半,也非随内容无限撑高)。
============================================================================ */
.amis-scope .eip4-treegrid-tree .cxd-Tree,
.amis-scope .eip4-treegrid-tree.cxd-Tree {
max-height: calc(100vh - 230px);
}