File tree 2 files changed +9
-5
lines changed
compiler-core/src/transforms
compiler-dom/src/transforms
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,14 @@ function walk(
111
111
112
112
// walk further
113
113
if ( child . type === NodeTypes . ELEMENT ) {
114
+ const isComponent = child . tagType === ElementTypes . COMPONENT
115
+ if ( isComponent ) {
116
+ context . scopes . vSlot ++
117
+ }
114
118
walk ( child , context )
119
+ if ( isComponent ) {
120
+ context . scopes . vSlot --
121
+ }
115
122
} else if ( child . type === NodeTypes . FOR ) {
116
123
// Do not hoist v-for single child because it has to be a block
117
124
walk ( child , context , child . children . length === 1 )
Original file line number Diff line number Diff line change @@ -60,11 +60,8 @@ type StringifiableNode = PlainElementNode | TextCallNode
60
60
* This optimization is only performed in Node.js.
61
61
*/
62
62
export const stringifyStatic : HoistTransform = ( children , context , parent ) => {
63
- if (
64
- parent . type === NodeTypes . ELEMENT &&
65
- ( parent . tagType === ElementTypes . COMPONENT ||
66
- parent . tagType === ElementTypes . TEMPLATE )
67
- ) {
63
+ // bail stringification for slot content
64
+ if ( context . scopes . vSlot > 0 ) {
68
65
return
69
66
}
70
67
You can’t perform that action at this time.
0 commit comments