我無法讓我的列表成爲全高。我的代碼更復雜的嵌套組件。但是我仍然可以使用這段代碼來複制它。這是一個龐然大物。 http://plnkr.co/edit/R0QgLz8cjyRHYOLf4uJW設置角度組件的全高
styles.css的
html, body {
min-height: 100%;
height: auto;
margin: 0;
}
app.component.css
.container {
height: 100%;
background: black;
color: white;
list.component.css
.row {
display: flex;
flex-direction: row;
}
.list {
width: 33%;
height: 100%;
flex-direction: column;
display: flex;
border-right: groove white 1px;
border-top: groove white 1px;
}
.item {
width: auto;
height: 100%;
flex-direction: column;
display: flex;
}
list.component.html
<div class="contents">
<button (click)="updateDocuments()">Update Document</button>
<div class="row">
<div class="list">
<div *ngFor="let document of documents; let i = index;">
{{i + 1}}. {{document}}
</div>
</div>
<div class="item">
this is an item
</div>
</div>
</div>
我希望這工作。如果我的列表比查看高度長,我無法滾動。 – mkteagle
你只是溢出它? – unitario
請參閱:http://plnkr.co/edit/54mG5kYrowh0ixAM6CUb?p=preview – unitario