[英]mat-dialog not filling screen - Angular
我在墊子對話框中有一個圖像輪播。 我為 mat-dialog 提供什么組件並不重要。 它們永遠不會填滿屏幕,所以我認為這不是 mat-dialog 中的特定組件的問題。
我希望它填充寬度 100% 和height:auto
以使圖像正確適合,但它似乎不起作用,我不知道為什么。
openImageGalleryMobile(images) {
const imageDialogRef = this.dialog.open(ImageCarouselComponent, {
panelClass: "matdialogStyle",
data: { images: images},
height: 'auto',
width: '100%',
});
imageDialogRef
.afterClosed()
.pipe(takeUntil(this.destroy))
.subscribe(result => { });
}
<div id="imageSlideshow">
<ngb-carousel *ngIf="images">
<ng-template ngbSlide *ngFor="let image of images">
<img src='{{image}}' alt="Random first side">
</ng-template>
</ngb-carousel>
</div>
我嘗試將.matdialogStyle
添加為一個新的未.matdialogStyle
css 類,但問題仍然存在。 我嘗試使用matdialogStyle
css 類將組件 css 文件或matdialogStyle
文件的寬度設置為 100%,但它永遠不會更新。 我感謝您的幫助!
你能試一下嗎 :
{
panelClass: "matdialogStyle",
data: { images: images},
height: 'auto',
minWidth: '100%',
}
你可以添加高度 100% :
minHeight: '100vh'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.