我有下面的代码:
角组件html
<canvas myChart>
[dataset] = "dataVariable"
[labels] = "labelVariable"
(chartHover) = "chartHover($event)"
</canvas>
Component.ts
public chartHover(e: any){
//Perform operations
}
当我将鼠标悬停在某个元素上时,实际上是在调用自定义弹出窗口。问题是我还没有找到触发mouseleave事件以使组件消失的方法。
我已经试过了:
(chartMouseLeave) = "funct()"
正确的方法是什么?
您可以将事件绑定到mouseout
画布的事件。
<canvas myChart>
[dataset] = "dataVariable"
[labels] = "labelVariable"
(chartHover) = "chartHover($event)"
(mouseout) = "mouseOut($event)"
</canvas>
零件
public mouseOut(event: any){
// set pop up open flag to false
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句