|
@@ -12,13 +12,13 @@ export function resolveSlots (
|
|
|
return slots
|
|
return slots
|
|
|
}
|
|
}
|
|
|
const defaultSlot = []
|
|
const defaultSlot = []
|
|
|
- let name, child
|
|
|
|
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
|
- child = children[i]
|
|
|
|
|
|
|
+ const child = children[i]
|
|
|
// named slots should only be respected if the vnode was rendered in the
|
|
// named slots should only be respected if the vnode was rendered in the
|
|
|
// same context.
|
|
// same context.
|
|
|
if ((child.context === context || child.functionalContext === context) &&
|
|
if ((child.context === context || child.functionalContext === context) &&
|
|
|
- child.data && (name = child.data.slot) != null) {
|
|
|
|
|
|
|
+ child.data && child.data.slot != null) {
|
|
|
|
|
+ const name = child.data.slot
|
|
|
const slot = (slots[name] || (slots[name] = []))
|
|
const slot = (slots[name] || (slots[name] = []))
|
|
|
if (child.tag === 'template') {
|
|
if (child.tag === 'template') {
|
|
|
slot.push.apply(slot, child.children)
|
|
slot.push.apply(slot, child.children)
|