File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ export function renderMixin (Vue: Class<Component>) {
36
36
_parentVnode
37
37
} = vm . $options
38
38
39
+ if ( vm . _isMounted ) {
40
+ // clone slot nodes on re-renders
41
+ for ( const key in vm . $slots ) {
42
+ vm . $slots [ key ] = cloneVNodes ( vm . $slots [ key ] )
43
+ }
44
+ }
45
+
39
46
if ( staticRenderFns && ! vm . _staticTrees ) {
40
47
vm . _staticTrees = [ ]
41
48
}
@@ -154,20 +161,14 @@ export function renderMixin (Vue: Class<Component>) {
154
161
fallback : ?Array < VNode >
155
162
) : ?Array < VNode > {
156
163
let slotNodes = this . $slots [ name ]
157
- if ( slotNodes ) {
158
- // warn duplicate slot usage
159
- if ( process . env . NODE_ENV !== 'production' ) {
160
- slotNodes . _rendered && warn (
161
- `Duplicate presense of slot "${ name } " found in the same render tree ` +
162
- `- this will likely cause render errors.` ,
163
- this
164
- )
165
- slotNodes . _rendered = true
166
- }
167
- // clone slot nodes on re-renders
168
- if ( this . _isMounted ) {
169
- slotNodes = cloneVNodes ( slotNodes )
170
- }
164
+ // warn duplicate slot usage
165
+ if ( slotNodes && process . env . NODE_ENV !== 'production' ) {
166
+ slotNodes . _rendered && warn (
167
+ `Duplicate presense of slot "${ name } " found in the same render tree ` +
168
+ `- this will likely cause render errors.` ,
169
+ this
170
+ )
171
+ slotNodes . _rendered = true
171
172
}
172
173
return slotNodes || fallback
173
174
}
You can’t perform that action at this time.
0 commit comments