fix(compiler): properly bail stringfication for nested slot elements

This commit is contained in:
Evan You
2021-03-05 11:10:58 -05:00
parent aea88c3280
commit f74b16ccfe
2 changed files with 9 additions and 5 deletions

View File

@@ -111,7 +111,14 @@ function walk(
// walk further
if (child.type === NodeTypes.ELEMENT) {
const isComponent = child.tagType === ElementTypes.COMPONENT
if (isComponent) {
context.scopes.vSlot++
}
walk(child, context)
if (isComponent) {
context.scopes.vSlot--
}
} else if (child.type === NodeTypes.FOR) {
// Do not hoist v-for single child because it has to be a block
walk(child, context, child.children.length === 1)