mirror of https://github.com/vuejs/vue.git
23 lines
590 B
JavaScript
23 lines
590 B
JavaScript
/* @flow */
|
|
|
|
export function resolveScopedSlots (
|
|
fns: ScopedSlotsData, // see flow/vnode
|
|
hasDynamicKeys?: boolean,
|
|
res?: Object
|
|
): { [key: string]: Function, $stable: boolean } {
|
|
res = res || { $stable: !hasDynamicKeys }
|
|
for (let i = 0; i < fns.length; i++) {
|
|
const slot = fns[i]
|
|
if (Array.isArray(slot)) {
|
|
resolveScopedSlots(slot, hasDynamicKeys, res)
|
|
} else if (slot) {
|
|
// marker for reverse proxying v-slot without scope on this.$slots
|
|
if (slot.proxy) {
|
|
slot.fn.proxy = true
|
|
}
|
|
res[slot.key] = slot.fn
|
|
}
|
|
}
|
|
return res
|
|
}
|