Skip to content

Commit

Permalink
access 'default' property safely
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Feb 16, 2017
1 parent d3521b8 commit 3aa6595
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
return slots;
}

slots.default = [];
var defaultSlotName = "default";
slots[defaultSlotName] = [];

for (var i = 0; i < children.length; i++) {
var child = children[i];
Expand All @@ -128,7 +129,7 @@
}
delete child.props.slot;
} else {
slots.default.push(child);
slots[defaultSlotName].push(child);
}
}

Expand Down
Loading

0 comments on commit 3aa6595

Please sign in to comment.