1 回答
TA贡献1818条经验 获得超11个赞
解决了我自己的问题,尽管感觉有点混乱。将其留在这里,以防其他人遇到此问题或有更优雅的方法来解决它,而无需一堆 :host 和 ::ng-deep 因为它们在将来的某个时候会消失。
我最终不得不为以下内容创建额外的 CSS 规则:
:host ::ng-deep .ui-tree {
border: 1px solid #adabab;
border-radius: 0px 5px 5px 0px;
background-color: rgba(0, 0, 0, 0.38);
color: #eaeaea;
padding: 0em 0em;
padding-right: 5px;
width: 22em; /* This constrains the width and creates the horizontal scrollbar when a p-tree node is expanded past this width. */
line-height: 15px !important;
max-height: 75vh;
overflow: overlay; /* Changed from auto to overlay */
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
/* This creates the horizontal scrollbar visible on top of the inner divs */
:host ::ng-deep .ui-tree .ui-tree-container {
overflow: initial;
}
/* This keeps a margin between horizontal overflow and the vertical scrollbar. Without it content would be hidden behind the scrollbar */
:host ::ng-deep .ui-tree .ui-tree-container .ui-treenode .ui-treenode-content .ui-treenode-label {
margin-right: 10px;
}
- 1 回答
- 0 关注
- 126 浏览
添加回答
举报