Skip to content

Commit

Permalink
feat: 增加 lifeCycle 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Sep 24, 2021
1 parent 1b3ac22 commit 7d18e6f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/compilers/renderer-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export class RendererCompiler {
))
}

body.push(ASSIGN(
BINARY(I('instance'), '.', BINARY(I('lifeCycle'), '.', I('inited'))),
I('true')
))

body.push(DEF('html', L('')))
body.push(ASSIGN(I('parentCtx'), I('ctx')))
const aNodeCompiler = new ANodeCompiler(info, !!this.options.ssrOnly, this.id, this.options.useProvidedComponentClass)
Expand Down Expand Up @@ -123,6 +128,13 @@ export class RendererCompiler {
[I('slots')]
)
),
ASSIGN(
BINARY(I('instance'), '.', I('lifeCycle')),
new MapLiteral([
[I('compiled'), I('true')],
[I('inited'), I('false')]
])
),
new If(
I('parentCtx'), [ASSIGN(
BINARY(I('instance'), '.', I('parentComponent')),
Expand Down

0 comments on commit 7d18e6f

Please sign in to comment.