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;
 //业务逻辑
  });

你可能感兴趣的:(vue,vue.js)