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')