Skip to content

Commit 0bcd9ff

Browse files
authored
feat: add scrollToNode for simulator host (alibaba#1075)
1 parent 6ee6b07 commit 0bcd9ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/shell/src/simulator-host.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {
22
BuiltinSimulatorHost,
33
} from '@alilc/lowcode-designer';
4-
import { simulatorHostSymbol } from './symbols';
4+
import { simulatorHostSymbol, nodeSymbol } from './symbols';
5+
import type Node from './node';
56

67
export default class SimulatorHost {
78
private readonly [simulatorHostSymbol]: BuiltinSimulatorHost;
@@ -51,6 +52,14 @@ export default class SimulatorHost {
5152
return this[simulatorHostSymbol].get(key);
5253
}
5354

55+
/**
56+
* scroll to specific node
57+
* @param node
58+
*/
59+
scrollToNode(node: Node) {
60+
this[simulatorHostSymbol].scrollToNode(node[nodeSymbol]);
61+
}
62+
5463
/**
5564
* 刷新渲染画布
5665
*/

0 commit comments

Comments
 (0)