具有组件的“可滚动”垫对话框

时间:2019-02-27 14:18:29

标签: angular scroll dialog

我发现有关滚动对话框的所有内容都是关于叠加层的,但这是为了描述对话框的行为,但是我需要滚动其中不包含在mat-content中的内容,因为它是一个整体组件。

要打开我正在使用的对话框:

  

const dialogRef = this.dialog.open(CadastroPessoaComponent,   dialogConfig)

对话框配置如下:

  

dialogConfig.width = '90%';

2 个答案:

答案 0 :(得分:1)

尝试将height中的dialogConfig设置为所需的对话框高度。

对我有用:

const dialogRef = this.dialog.open(CadastroPessoaComponent, {
   height: '300px'
}

如果组件内容的高度超过300像素,则会添加溢出。

有关可用的对话框配置的完整列表,请检查MatDialog API

答案 1 :(得分:0)

以防万一,不知道需要设置多少高度。您可以:

  openDialog() {
    this.dialog.open(myComponent, {
      height: '100%'
    })
  }

如果您想要在对话框和页面边框之间进行一些填充。您应该将高度设置为低于 100%。

  openDialog() {
    this.dialog.open(myComponent, {
      height: '90%'
    })
  }
相关问题