Closed hahadaba closed 10 months ago
Hello @hahadaba. Your feedback has been received, and you will be notified in the issue area when the problem is resolved. 你好 @hahadaba,已收到你反馈的问题,问题解决后将在issue区域通知你。
completeCallback
你的用法不对,当completeCallback
回调执行的时候,dom已经被销毁了。你再次执行销毁方法,找不到dom,自然就报错了。
Version of js-screen-shot
1.9.9-rc.7
Operating system and its version
Windows
Browser and its version
版本 120.0.2210.61 (正式版本) (64 位)
Sandbox to reproduce
No response
What happened?
// 创建实例 let instance = new ScreenShot({ completeCallback, closeCallback, cancelCallback, triggerCallback, enableWebRtc: finalEnableWebRtc, canvasWidth: window.innerWidth, canvasHeight: window.innerHeight, noScroll: false, showScreenData: true, position: { left: 0, top: 0 }, cropBoxInfo: { x: 200, y: 200, w: window.innerWidth - 400, h: window.innerHeight - 400, }, level: 3000, });
// 在回调中销毁实例 const completeCallback = () => { instance.destroyComponents() // <------报错了 instance=null }
报错信息