[英]Is there a prop available to call a function when close button (cross icon) is clicked for introjs-react step?
我對introjs-react
很陌生。 我瀏覽了文檔並知道有 2 個可用的道具onExit
和onComplete
。 前一個在我們跳過一個步驟時調用(例如,在覆蓋層上的步驟之外單擊時),而后者在按下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.