mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
feat: return unbind function for onChangeDetecting & onChangeSelection
This commit is contained in:
parent
171b1013b2
commit
30267cb173
@ -204,7 +204,7 @@ export default class DocumentModel {
|
|||||||
* 当前 document 的 hover 变更事件
|
* 当前 document 的 hover 变更事件
|
||||||
*/
|
*/
|
||||||
onChangeDetecting(fn: (node: Node) => void) {
|
onChangeDetecting(fn: (node: Node) => void) {
|
||||||
this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
|
return this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
|
||||||
fn(Node.create(node)!);
|
fn(Node.create(node)!);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ export default class DocumentModel {
|
|||||||
* 当前 document 的选中变更事件
|
* 当前 document 的选中变更事件
|
||||||
*/
|
*/
|
||||||
onChangeSelection(fn: (ids: string[]) => void) {
|
onChangeSelection(fn: (ids: string[]) => void) {
|
||||||
this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
|
return this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
|
||||||
fn(ids);
|
fn(ids);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user