![](/img/trans.png)
[英]What is the proper way to close a camera in Windows 8 Javascript?
[英]What is the proper way to close PhotoEditorSDK ReactUI?
根據他們的文檔,photoeditorsdk關閉時有一個事件。
當用戶單擊關閉按鈕時,編輯器將發出
close
事件。
但是,沒有指示如何正確關閉編輯器。 我試圖像這樣在div編輯器中刪除所有項目:
// Closing
imageEditor.editor.on('close', (result) => {
console.log('Closing.....');
// TODO: This is not working.
$("#" + imageEditor.editorId).empty();
});
此解決方案的問題在於,如果我嘗試再次加載編輯器,將無法正常工作。
關閉PhotoEditorSDK ReactUI的正確方法是什么?
您應該執行以下操作:
imageEditor
.editor // @link https://docs.photoeditorsdk.com/apidocs/html5/v4/PhotoEditorSDK.html
.on('close', () => imageEditor.editor.dispose());
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.