js vue 鼠标悬停

 let hoverTimeOut = null

 item.on("mouseover", async (e) => {

    if (hoverTimeOut===null) {
      hoverTimeOut = setTimeout(() => {
        hoverTimeOut= null;
   //业务逻辑
    messageBase(info.code, position);
              }, 1000); 
            }


  });
  item.on("mouseout", (e) => {
    console.log('离开')
     clearTimeout(hoverTimeOut);
      hoverTimeOut = null;
 //业务逻辑
  });

猜你喜欢

转载自blog.csdn.net/qq_51389137/article/details/132608421