Skip to content

Commit

Permalink
fixed empty template issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed Jan 9, 2018
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
Expand Up @@ -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();
}
Expand Down

0 comments on commit 6bbb304

Please sign in to comment.