首页 > 解决方案 > 如何停止从外部按钮点击触发

问题描述

垫子扩展通过单击页面上的外部按钮不断切换。它只能通过单击其面板上的触发图标(向下/向上箭头)来切换。


 mat-expansion-panel [expanded]=expandBox *ngIf="BoxEnable">
      <mat-expansion-panel-header>
        <mat-panel-title>
                    <span class="title_text"><b>{{Box_title}}</b></span>
                    <span (click)="addNote($event)" matTooltip="Add Text" class="notes-add-btn">
                        <i class="fa fa-plus" aria-hidden="true"></i>
                    </span>
                </mat-panel-title>
            </mat-expansion-panel-header>
</mat-expansion-panel>

标签: angulareventstogglepanel

解决方案


您可以使用(click)="event.stopPropagation()"来停止事件冒泡


推荐阅读