Skip to content

Commit

Permalink
fix(taroize): 只有初次调用才需要清空已使用组件
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Feb 14, 2019
1 parent 9f45ab3 commit b265628
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/taroize/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function parseModule (jsx: NodePath<t.JSXElement>, dirPath: string, type:
jsx.remove()
return imports
} else {
const { wxml } = parseWXML(dirPath, getWXMLsource(dirPath, srcValue, type))
const { wxml } = parseWXML(dirPath, getWXMLsource(dirPath, srcValue, type), true)
const block = buildBlockElement()
try {
if (wxml) {
Expand Down
2 changes: 1 addition & 1 deletion packages/taroize/src/wxml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ export function parseWXML (dirPath: string, wxml?: string, parseImport?: boolean
} {
if (!parseImport) {
errors.length = 0
usedComponents.clear()
}
usedComponents.clear()
usedComponents.add('Block')
let wxses: WXS[] = []
let imports: Imports[] = []
Expand Down

0 comments on commit b265628

Please sign in to comment.