refactor(compiler-vapor): remove Object.entries

This commit is contained in:
三咲智子 Kevin Deng 2024-05-28 21:31:30 +08:00
parent ca61022e69
commit c97dee3e3c
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -148,10 +148,10 @@ function genModelModifiers(
}
function genSlots(slots: ComponentSlots, context: CodegenContext) {
const slotList = Object.entries(slots)
const names = Object.keys(slots)
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)]),
)
}