<div (click)="parentAction()">
<div (click)="childAction()"></div>
</div>
我想仅在此处触发childAction
,但parentAction
和childAction
正在执行。如何在此停止parentAction
?
答案 0 :(得分:3)
<div (click)="parentAction()">
<div (click)="$event.stopPropagation();childAction()"></div>
</div>