* 移除当前节点
(
useMutator = true,
purge = true,
options: NodeRemoveOptions = { suppressRemoveEvent: false },
)
| 613 | * 移除当前节点 |
| 614 | */ |
| 615 | remove( |
| 616 | useMutator = true, |
| 617 | purge = true, |
| 618 | options: NodeRemoveOptions = { suppressRemoveEvent: false }, |
| 619 | ) { |
| 620 | if (this.parent) { |
| 621 | if (!options.suppressRemoveEvent) { |
| 622 | this.document.designer.editor?.eventBus.emit('node.remove.topLevel', { |
| 623 | node: this, |
| 624 | index: this.parent?.children?.indexOf(this), |
| 625 | }); |
| 626 | } |
| 627 | if (this.isSlot()) { |
| 628 | this.parent.removeSlot(this); |
| 629 | this.parent.children?.internalDelete(this, purge, useMutator, { suppressRemoveEvent: true }); |
| 630 | } else { |
| 631 | this.parent.children?.internalDelete(this, purge, useMutator, { suppressRemoveEvent: true }); |
| 632 | } |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | /** |
| 637 | * 锁住当前节点 |
nothing calls this directly
no test coverage detected