From 2b80c0257bbf46d19e3ebfba4faa950e2c4dc2ec Mon Sep 17 00:00:00 2001 From: meixg Date: Fri, 15 Apr 2022 12:29:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20revert=20"computed=20=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=9C=A8=20inited=20=E4=B9=8B=E5=89=8D=E8=B0=83=E7=94=A8"=20#1?= =?UTF-8?q?44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aa21455f8cefdb6d1e74c1f4d58cae36cc7250cd --- src/compilers/renderer-compiler.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compilers/renderer-compiler.ts b/src/compilers/renderer-compiler.ts index 4fb34396..9fc39fb7 100644 --- a/src/compilers/renderer-compiler.ts +++ b/src/compilers/renderer-compiler.ts @@ -98,11 +98,6 @@ export class RendererCompiler { body.push(...this.emitInitData()) } - // calc computed - for (const name of info.getComputedNames()) { - body.push(ASSIGN(BINARY(I('data'), '[]', L(name)), new ComputedCall(name))) - } - // call inited if (info.hasMethod('inited')) { body.push(createTryStatement( @@ -116,6 +111,11 @@ export class RendererCompiler { )) } + // calc computed + for (const name of info.getComputedNames()) { + body.push(ASSIGN(BINARY(I('data'), '[]', L(name)), new ComputedCall(name))) + } + body.push(ASSIGN( BINARY(I('instance'), '.', BINARY(I('lifeCycle'), '.', I('inited'))), I('true')