The mouse moves into and out of the event, triggering the suspension with delay

  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;
  });

Guess you like

Origin blog.csdn.net/qq_51389137/article/details/132823944