Material Angular Accordion header/title height

后端 未结 4 1583
难免孤独
难免孤独 2021-02-03 18:52

So I\'ve been trying to adopt Materials Accordion in my Web Application development.

However having some troubles getting the header to expand in size as the content gro

4条回答
  •  -上瘾入骨i
    2021-02-03 18:56

    Adding a general options/settings to set height for all panels across application:

    MatExpansionPanelDefaultOptions

    import { NgModule } from '@angular/core';
    import { MAT_EXPANSION_PANEL_DEFAULT_OPTIONS } from '@angular/material';
    
    @NgModule({
        providers: [
            {
                provide: MAT_EXPANSION_PANEL_DEFAULT_OPTIONS,
                useValue: {
                    hideToggle: true,
                    expandedHeight: '50px',
                    collapsedHeight: '50px'
                }
            }
        ]
    })
    export class AppMaterialModule {}
    

提交回复
热议问题