Skip to content

Commit

Permalink
fix: revert "computed 应该在 inited 之前调用" #144
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Apr 15, 2022
1 parent d62ad88 commit 2b80c02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compilers/renderer-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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')
Expand Down

0 comments on commit 2b80c02

Please sign in to comment.