Skip to content

Commit

Permalink
feat: Model中的Collection添加Cell,通过事件告知Scheduler调度器,进行相应的CellView的创建,并通过…
Browse files Browse the repository at this point in the history
…queueJob任务队列进行视图渲染
  • Loading branch information
yelikang committed Aug 20, 2024
1 parent 0e97ca4 commit 7478b0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/x6/src/model/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export class Collection extends Basecoat<Collection.EventArgs> {
}
this.trigger('added', args)
if (!localOptions.dryrun) {
// 元素添加后触发added事件,从而创建对应的CellView对象(NodeView、EdgeView )
// 会触发model.notify('cell:added')事件,Scheduler 监听了model.on('cell:added')事件,从而在Scheduler中创建对应的CellView对象(NodeView、EdgeView )
cell.notify('added', { ...args })
}
})
Expand Down

0 comments on commit 7478b0b

Please sign in to comment.