html - 如何增加 Angular 5 中垫对话框的自动高度?

标签 html css angular angular-material

  uploadFiles(): void {
    const dialogRef = this.dialog.open(AddNewFilesOrImagesComponent, {
      width: '620px',
      height : '100%',
    });
  }

如果高度 100% UI 看起来像这样(在上传按钮下不需要空格)

enter image description here

如果我在 px 中设置固定高度(它使 UI 可滚动)

  uploadFiles(): void {
    const dialogRef = this.dialog.open(AddNewFilesOrImagesComponent, {
      width: '620px',
      height : '250px',
    });
  }

enter image description here

如果我选择文件,我想要实际的这种类型,它会自动增加它的高度(当我选择图像时,我想增加 matdialogbox 的自动高度)

enter image description here

最佳答案

试试这个,它将为您的matdialog

占用页面的完整高度
 uploadFiles(): void {
   const dialogRef = this.dialog.open(AddNewFilesOrImagesComponent, {
        width: '100%',
        minHeight: 'calc(100vh - 90px)',
        height : 'auto'
    });
 }

关于html - 如何增加 Angular 5 中垫对话框的自动高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53598476/

相关文章:

html - CSS 选择器和伪类

Angular 4 : how to pass an argument to a Service provided in a module file

html - 将 float 元素组织成动态网格

html - 防止嵌套的导航项进入下一行?

javascript - 如何确保多个setinterval函数不互相干扰

html - CSS 第 n 个图像 x 变换

html - CSS:使包含 float 元素的元素居中

html - 如何设置 HTML 片段链接到页面的下方多远?

javascript - Angular 2 路由 - 路由器 RC3

angular - ngrx 仅在存储为空时从服务器加载数据