Skip to content

Commit

Permalink
refactor(transformer): 快应用组件根组件加入 if 属性
Browse files Browse the repository at this point in the history
if: priTaroCompReady
  • Loading branch information
yuche committed Aug 13, 2019
1 parent c8d565f commit ee67334
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/taro-transformer-wx/src/create-html-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ export const createHTMLElement = (options: Options, isFirstEmit = false) => {
}
}
}

if (isFirstEmit && name === 'div' && !transformOptions.isRoot) {
options.attributes = {
...options.attributes,
'if': '{{priTaroCompReady}}'
}
}
}

const isVoidTag = voidHtmlTags.has(options.name)
Expand Down

0 comments on commit ee67334

Please sign in to comment.