Răsfoiți Sursa

refactor(compiler-vapor): remove Object.entries

三咲智子 Kevin Deng 2 ani în urmă
părinte
comite
c97dee3e3c
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      packages/compiler-vapor/src/generators/component.ts

+ 3 - 3
packages/compiler-vapor/src/generators/component.ts

@@ -148,10 +148,10 @@ function genModelModifiers(
 }
 }
 
 
 function genSlots(slots: ComponentSlots, context: CodegenContext) {
 function genSlots(slots: ComponentSlots, context: CodegenContext) {
-  const slotList = Object.entries(slots)
+  const names = Object.keys(slots)
   return genMulti(
   return genMulti(
-    slotList.length > 1 ? DELIMITERS_OBJECT_NEWLINE : DELIMITERS_OBJECT,
-    ...slotList.map(([name, slot]) => [name, ': ', ...genBlock(slot, context)]),
+    names.length > 1 ? DELIMITERS_OBJECT_NEWLINE : DELIMITERS_OBJECT,
+    ...names.map(name => [name, ': ', ...genBlock(slots[name], context)]),
   )
   )
 }
 }