在Angular Material 2中设置底部工作表的宽度

bla*_*ord 1 angular-material2 angular

我可以在Angular Material 2中设置底片的宽度(固定或百分比)吗?

非常感谢

Tab*_*med 8

使用panelClassconfig参数.例如:

styles.css:(全局样式文件而不是component.css文件)

.custom-width {
    width: 450px;
}
Run Code Online (Sandbox Code Playgroud)

In your component.ts:

this.bottomSheet.open(BottomSheetOverviewExampleSheet, {
  panelClass: 'custom-width'
});
Run Code Online (Sandbox Code Playgroud)

https://stackblitz.com/angular/qvokqxjgbrn

注意:只有像素宽度才有效.