609e85e0d67703ea316833fc6331a68a04c2dde750595410c01160ed45d4bf9399045539dfba984aae62c2d11c349d4dc4398dbdc66f56dd00b12ed7ee04f5 718 B

123456789101112131415161718192021222324252627
  1. /* @flow */
  2. export function resolveScopedSlots (
  3. fns: ScopedSlotsData, // see flow/vnode
  4. res?: Object,
  5. // the following are added in 2.6
  6. hasDynamicKeys?: boolean,
  7. contentHashKey?: number
  8. ): { [key: string]: Function, $stable: boolean } {
  9. res = res || { $stable: !hasDynamicKeys }
  10. for (let i = 0; i < fns.length; i++) {
  11. const slot = fns[i]
  12. if (Array.isArray(slot)) {
  13. resolveScopedSlots(slot, res, hasDynamicKeys)
  14. } else if (slot) {
  15. // marker for reverse proxying v-slot without scope on this.$slots
  16. if (slot.proxy) {
  17. slot.fn.proxy = true
  18. }
  19. res[slot.key] = slot.fn
  20. }
  21. }
  22. if (contentHashKey) {
  23. (res: any).$key = contentHashKey
  24. }
  25. return res
  26. }