Skip to content

Commit 47fc75d

Browse files
committed
fix: 修复control组件某些情况下无法销毁的问题
1 parent 1e2e1e3 commit 47fc75d

File tree

1 file changed

+5
-1
lines changed
  • packages/extension/src/components/control

1 file changed

+5
-1
lines changed

packages/extension/src/components/control/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ const Control: ControlPlugin = {
7676
domContainer.appendChild(Control.__tool);
7777
},
7878
destroy() {
79-
Control.__domContainer?.removeChild(Control.__tool);
79+
try {
80+
Control.__domContainer?.removeChild(Control.__tool);
81+
} catch (e) {
82+
console.warn('unexpect destory error', e);
83+
} // todo: 目前某些情况存在此处报错情况,暂时这样处理。后续改成class写法就没有问题了。
8084
},
8185
__getControlTool(): HTMLElement {
8286
const NORMAL = 'lf-control-item';

0 commit comments

Comments
 (0)