Skip to content

Commit

Permalink
fixed empty template issue
Browse files Browse the repository at this point in the history
Gcaufy committed Jan 9, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8514eae commit 6bbb304
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/wepy-cli/src/compile-wpy.js
Original file line number Diff line number Diff line change
@@ -420,6 +420,11 @@ export default {
// 存在有 scoped 部分就需要 更新 template.code
var node = this.createParser(opath).parseFromString(rst.template.code);
walkNode(node, rst.moduleId);

// fixed https://github.com/jindw/xmldom/blob/master/dom.js#L915
if (node.nodeType === 9 && !node.documentElement) {
node.documentElement = node;
}
// 更新 template.code
rst.template.code = node.toString();
}

0 comments on commit 6bbb304

Please sign in to comment.