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) {
const root_slots = {};
for (const slot_name in slots) {
let elements = slots[slot_name];
if (!Array.isArray(elements)) {
elements = [elements];
}
root_slots[slot_name] = [create_root_slot_fn(elements)];
export function createSlot(input) {
var key, tmp, slots={};
for (key in input) {
tmp = input[key];
slots[key] = [create_root_slot_fn(Array.isArray(tmp) ? tmp : [tmp])];
}
return root_slots;
return slots;
}

Loading…
Cancel
Save