selection-service.mdx 305 B

1234567891011121314
  1. # SelectionService
  2. 用于控制选择的节点
  3. [> API Detail](https://flowgram.ai/auto-docs/core/classes/SelectionService.html)
  4. ## Usage
  5. ```tsx pure
  6. // Listen Selection Change
  7. ctx.selection.onSelectionChanged((nodes) => {
  8. })
  9. // Select All Nodes
  10. ctx.selection.selection = ctx.document.getAllNodes()
  11. ```