Skip to content

Commit

Permalink
fix(taroize): 装饰器没有插入到类声明中, close #2740
Browse files Browse the repository at this point in the history
class 声明 的 ast 装饰器一定是一个数组,目前版本的 typing 有误
  • Loading branch information
yuche committed Apr 12, 2019
1 parent 97067d5 commit f6c15b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/taroize/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function parseScript (
componentType,
refId
)
if (componentType !== 'App' && !classDecl.decorators) {
if (componentType !== 'App' && classDecl.decorators!.length === 0) {
classDecl.decorators = [buildDecorator(componentType)]
}
ast.program.body.push(
Expand Down Expand Up @@ -409,6 +409,8 @@ function parsePage (
[]
)

debugger

if (weappConf) {
classDecl.decorators = [buildDecorator(componentType || 'Page', weappConf)]
}
Expand Down

0 comments on commit f6c15b8

Please sign in to comment.