angular - 如何停止从外部按钮点击触发
问题描述
垫子扩展通过单击页面上的外部按钮不断切换。它只能通过单击其面板上的触发图标(向下/向上箭头)来切换。
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>
解决方案
您可以使用(click)="event.stopPropagation()"
来停止事件冒泡
推荐阅读
- java - 在 O(log n) 时间内计算排序 int 数组中具有相同数字的数字
- javascript - 无法在引导程序中的文本框前面放置一个按钮
- c++ - C++ 替代 Java 的 split(str, -1)
- spring - Spring batch - 根据之前拆分完成状态的一些流程定义拆分
- r - 绘制函数的函数
- python - Is it faster to use n = len(s) instead of using len(s) directly?
- c# - 在 UI 线程上调用异步方法
- gradle - 如何使用 Gradle Kotlin-DSL 添加本地资源
- regex - powershell拆分中的正则表达式
- java - 用于数据库视图(不是表)的 JPA/SpringBoot 存储库