From 7478b0b660bca873f109754588e982ed3598c55c Mon Sep 17 00:00:00 2001 From: yelikang <530331059@qq.com> Date: Tue, 20 Aug 2024 17:46:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Model=E4=B8=AD=E7=9A=84Collection?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Cell=EF=BC=8C=E9=80=9A=E8=BF=87=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=91=8A=E7=9F=A5Scheduler=E8=B0=83=E5=BA=A6=E5=99=A8?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E8=A1=8C=E7=9B=B8=E5=BA=94=E7=9A=84CellView?= =?UTF-8?q?=E7=9A=84=E5=88=9B=E5=BB=BA=EF=BC=8C=E5=B9=B6=E9=80=9A=E8=BF=87?= =?UTF-8?q?queueJob=E4=BB=BB=E5=8A=A1=E9=98=9F=E5=88=97=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/x6/src/model/collection.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/x6/src/model/collection.ts b/packages/x6/src/model/collection.ts index 38c38918cd1..e612b0b041f 100644 --- a/packages/x6/src/model/collection.ts +++ b/packages/x6/src/model/collection.ts @@ -105,6 +105,8 @@ export class Collection extends Basecoat { } 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 }) } })