事件传播在angular4中不起作用
我有这样一个div结构:事件传播在angular4中不起作用,angular,event-propagation,Angular,Event Propagation,我有这样一个div结构: <div [ngClass]="showDragDrop == true ? 'show' : 'fade' " (click)="hideWindow($event); $event.stopPropagation()"> <input type="file" (change)="uploadFile($event)" .../> </div> 这个 还有这个 (event)
<div [ngClass]="showDragDrop == true ? 'show' : 'fade' "
(click)="hideWindow($event); $event.stopPropagation()">
<input type="file" (change)="uploadFile($event)" .../>
</div>
这个
还有这个
(event)="doSomething($event); false"
但它不工作移动
事件。停止播放()代码>要输入,请单击()
或者,更简洁的版本,如@yurzui所建议的:
<input type="file" (click)="$event.stopPropagation()" ...>
移动事件停止播放()代码>要输入,请单击()
或者,更简洁的版本,如@yurzui所建议的:
<input type="file" (click)="$event.stopPropagation()" ...>
@yurzui,我正忙着制作演示,没有看到你的评论:(@Vega,太好了ok@yurzui,我正忙着做演示,没有看到你的评论:(@Vega,没关系
<input type="file" (click)="removetheClick($event)" ...>
removetheClick(event){
event.stopPropagation();
}
<input type="file" (click)="$event.stopPropagation()" ...>