【发布时间】:2021-09-27 08:29:37
【问题描述】:
我想使用扩展面板,结果我想打开多个面板,比如这个例子: open example
这是我的代码:
<mat-accordion>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
This is the expansion title
</mat-panel-title>
<mat-panel-description>
This is a summary of the content
</mat-panel-description>
</mat-expansion-panel-header>
<p>This is the primary content of the panel.</p>
</mat-expansion-panel>
<mat-expansion-panel (opened)="panelOpenState = true"
(closed)="panelOpenState = false">
<mat-expansion-panel-header>
<mat-panel-title>
Self aware panel
</mat-panel-title>
<mat-panel-description>
Currently I am {{panelOpenState ? 'open' : 'closed'}}
</mat-panel-description>
</mat-expansion-panel-header>
<p>I'm visible because I am open</p>
</mat-expansion-panel>
</mat-accordion>
【问题讨论】:
-
很难理解您到底想要实现什么,您能否澄清问题,并提供一些不起作用的代码?代码示例是来自material.angular.io/components/expansion/… 的copypasta
-
以下 stackblitz 提供了嵌套垫扩展面板的最小示例stackblitz.com/edit/…
-
@Simplicity's_Strength 是的!因为我不知道如何在有角度的材料中编辑代码,所以我想要的是当我单击面板中的箭头时,我想打开卡片(多个),就像它在示例中显示的那样(请检查链接)跨度>
标签: html angular angular-material panel expansion