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 關注
- 196 瀏覽
添加回答
舉報