Skip to content

Commit 9cc3eeb

Browse files
authored
Merge pull request #4 from SmallStoneSK/dev
【fix】修复compile时,单标签闭合结点解析错误
2 parents 3ffc40f + 999eef5 commit 9cc3eeb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

《template 模板是怎样通过 Compile 编译的》.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ function parseHTML () {
179179
currentParent.children.push(element);
180180
}
181181

182-
stack.push(element);
183-
currentParent = element;
182+
if(!startTagMatch.unarySlash) {
183+
stack.push(element);
184+
currentParent = element;
185+
}
184186
continue;
185187
}
186188
} else {

0 commit comments

Comments
 (0)