gpt4 book ai didi

javascript - 关闭 PhotoEditorSDK ReactUI 的正确方法是什么?

转载 作者:行者123 更新时间:2023-12-03 01:01:37 25 4
gpt4 key购买 nike

根据他们的文档,当 photoeditorsdk 接近时会发生一个事件。

the editor will emit a close event when the user clicks the close button.

Source

但是,没有说明如何正确关闭编辑器。我尝试删除 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());

关于javascript - 关闭 PhotoEditorSDK ReactUI 的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52599969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com