[Angular Material] Expansion-panel 用法小記錄
實現個別開啟個別關閉又可以全部開啟全部關閉 以下範例是3個可以可以伸縮的框框 主要屬性是這兩個 < mat-accordion #accordion = " matAccordion " [multi] = " true " > 再配上給的方法放在button上 (click) = " accordion.openAll() " (click) = " accordion.closeAll() " TS檔 export class Sc2AccountFeaturesSettingComponent implements OnInit { panelOpenState1 = false ; panelOpenState2 = false ; panelOpenState3 = false ; } HTML檔 < button mat-raised-button color = " primary " (click) = " accordion.openAll() " > 全部展開 </ button > < button mat-raised-button color = " primary " (click) = " accordion.closeAll() " > 全部收合 </ button > < mat-accordion #accordion = " matAccordion " [multi] = " true " > < mat-expansion-panel (opened) = " panelOpenState1 = true " (closed) = " panelOpenState1 = false " > < mat...