]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: remove unnecessary loop
authorEvan You <yyx990803@gmail.com>
Tue, 30 Jun 2020 15:43:15 +0000 (11:43 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 30 Jun 2020 15:43:15 +0000 (11:43 -0400)
packages/runtime-core/src/componentSlots.ts

index a940fd5f7bddffcc2075078664feef87fda56783..28f6ab1ef484c67eaa294376f3895320f47e5734 100644 (file)
@@ -130,9 +130,7 @@ export const updateSlots = (
       if (__DEV__ && isHmrUpdating) {
         // Parent was HMR updated so slot content may have changed.
         // force update slots and mark instance for hmr as well
-        for (const key in children as RawSlots) {
-          if (key !== '_') slots[key] = (children as Slots)[key]
-        }
+        extend(slots, children as Slots)
       } else if (
         // bail on dynamic slots (v-if, v-for, reference of scope variables)
         !(vnode.patchFlag & PatchFlags.DYNAMIC_SLOTS)