首页 > 解决方案 > Sap ui5:为什么 attachEvent 方法不适用于“mouseenter”事件?

问题描述

我正在尝试将 mouseenter 处理程序添加到其中一个控件(PlanningCalendarAppointment)。这就是我已经尝试过的。

control.attachEvent("mouseenter", function () {
       console.log("test"); // Fixed compilation error
});

但它不会产生任何影响。

标签: javascriptsapui5eventhandlermouseenter

解决方案


请试试 。attachBrowserEvent而不是 attachEvent:

control.attachBrowserEvent("mouseenter", function () {
       console.log("test"); // Fixed compilation error
});

推荐阅读