鼠标移入离开事件,延迟触发悬浮

  item.on("mouseover", async (e) => {
    if (selectData.sceneValue === "2") {
      return;
    }
    if (hoverTimeOut === null) {
      hoverTimeOut = setTimeout(() => {
        hoverTimeOut = null;
        messageData.value = info;
        message_type.value = info.code;
        const position = [e.lnglat.KL, e.lnglat.kT];
        hoverStatus.value = !hoverStatus.value;
        isMessage.value = true;
        routeInfoSave(info);
        nextTick(()=>{
          messageBase(info.code, position);   
        })
      }, 1000);
    }
  });
  item.on("mouseout", (e) => {
    clearTimeout(hoverTimeOut);
    hoverTimeOut = null;
  });

你可能感兴趣的:(java,前端,服务器)