簡體   English   中英

當為 introjs-react 步驟單擊關閉按鈕(十字圖標)時,是否有可調用 function 的道具?

[英]Is there a prop available to call a function when close button (cross icon) is clicked for introjs-react step?

我對introjs-react很陌生。 我瀏覽了文檔並知道有 2 個可用的道具onExitonComplete 前一個在我們跳過一個步驟時調用(例如,在覆蓋層上的步驟之外單擊時),而后者在按下done時調用。 我想在按下步驟上的關閉按鈕(十字圖標)時調用一個方法。

這就是我當前步驟的樣子工具提示

這是我的代碼的樣子

<Steps
      enabled={activateDemo}
      steps={steps.map((step) => ({ ...step, tooltipClass: classes.tooltipClass }))}
      initialStep={0}
      ref={(ref) => {
        introJsRef.current = ref;
      }}
      options={{
        exitOnOverlayClick: false,
        scrollToElement: true,
        scrollTo: 'tooltip',
        disableInteraction: true,
        showButtons: true,
      }}
      onBeforeChange={(nextStepIndex) => {
        if (steps[nextStepIndex] && introJsRef.current)
          introJsRef.current!.updateStepElement(nextStepIndex);
        return true;
      }}
      onExit={onExit}
      onComplete={onComplete}
      onClose={onComplete} // <---- Does something of this sort exists??????
    />
  );

這是我正在瀏覽的文檔 任何線索將不勝感激。

能回答你的問題嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM