Update src/runtime/slot/index.ts

Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
pull/4296/head
Tan Li Hau 5 years ago committed by GitHub
parent 969ad237b1
commit 6ec1d4ebb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,14 +22,11 @@ function create_root_slot_fn(elements) {
}; };
} }
export function createSlot(slots) { export function createSlot(input) {
const root_slots = {}; var key, tmp, slots={};
for (const slot_name in slots) { for (key in input) {
let elements = slots[slot_name]; tmp = input[key];
if (!Array.isArray(elements)) { slots[key] = [create_root_slot_fn(Array.isArray(tmp) ? tmp : [tmp])];
elements = [elements];
}
root_slots[slot_name] = [create_root_slot_fn(elements)];
} }
return root_slots; return slots;
} }

Loading…
Cancel
Save