From a971bc786ca7a1bea9677b3b98a921171e0a1bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Thu, 3 Jun 2021 21:21:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20readonly=20=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E8=A2=AB=E7=BC=96=E8=AF=91=E5=88=B0=20class?= =?UTF-8?q?=20property=20=E4=B9=8B=E5=90=8E=E4=BA=86,=20=E5=85=88=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E7=BB=95=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/designer/src/document/node/props/props.ts | 14 +++++++++----- packages/ignitor/build.json | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/designer/src/document/node/props/props.ts b/packages/designer/src/document/node/props/props.ts index d21982de2..3c40d17fd 100644 --- a/packages/designer/src/document/node/props/props.ts +++ b/packages/designer/src/document/node/props/props.ts @@ -41,10 +41,9 @@ export class Props implements IPropParent { return this; } - private stash = new PropStash(this, prop => { - this.items.push(prop); - prop.parent = this; - }); + readonly owner: Node; + + private stash: PropStash; /** * 元素个数 @@ -55,7 +54,12 @@ export class Props implements IPropParent { @obx type: 'map' | 'list' = 'map'; - constructor(readonly owner: Node, value?: PropsMap | PropsList | null, extras?: object) { + constructor(owner: Node, value?: PropsMap | PropsList | null, extras?: object) { + this.owner = owner; + this.stash = new PropStash(this, prop => { + this.items.push(prop); + prop.parent = this; + }); if (Array.isArray(value)) { this.type = 'list'; this.items = value.map(item => new Prop(this, item.value, item.name, item.spread, { skipSetSlot: true })); diff --git a/packages/ignitor/build.json b/packages/ignitor/build.json index f86c93cb1..9262596f3 100644 --- a/packages/ignitor/build.json +++ b/packages/ignitor/build.json @@ -1,6 +1,6 @@ { "entry": { - "engine-core": "../engine/src/index-core.ts", + "engine-core": "../engine/src/index.ts", "vision-polyfill": "../vision-polyfill/src/index.ts", "react-simulator-renderer": "../react-simulator-renderer/src/index.ts", "rax-simulator-renderer": "../rax-simulator-renderer/src/index.ts"