Evan You 9 jaren geleden
bovenliggende
commit
38516b4942
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      src/core/instance/render-helpers/resolve-slots.js

+ 3 - 3
src/core/instance/render-helpers/resolve-slots.js

@@ -12,13 +12,13 @@ export function resolveSlots (
     return slots
   }
   const defaultSlot = []
-  let name, child
   for (let i = 0, l = children.length; i < l; i++) {
-    child = children[i]
+    const child = children[i]
     // named slots should only be respected if the vnode was rendered in the
     // same context.
     if ((child.context === context || child.functionalContext === context) &&
-        child.data && (name = child.data.slot) != null) {
+        child.data && child.data.slot != null) {
+      const name = child.data.slot
       const slot = (slots[name] || (slots[name] = []))
       if (child.tag === 'template') {
         slot.push.apply(slot, child.children)