fix: bail stringification for slots

fix #1281, close #1286
This commit is contained in:
Evan You
2020-06-10 14:31:51 -04:00
parent fbaf52ae9f
commit 9b5d13e598
4 changed files with 59 additions and 12 deletions

View File

@@ -59,7 +59,15 @@ type StringifiableNode = PlainElementNode | TextCallNode
*
* This optimization is only performed in Node.js.
*/
export const stringifyStatic: HoistTransform = (children, context) => {
export const stringifyStatic: HoistTransform = (children, context, parent) => {
if (
parent.type === NodeTypes.ELEMENT &&
(parent.tagType === ElementTypes.COMPONENT ||
parent.tagType === ElementTypes.TEMPLATE)
) {
return
}
let nc = 0 // current node count
let ec = 0 // current element with binding count
const currentChunk: StringifiableNode[] = []