Home / File/ resolve-scoped-slots.ts — vue Source File

resolve-scoped-slots.ts — vue Source File

Architecture documentation for resolve-scoped-slots.ts, a typescript file in the vue codebase. 2 imports, 1 dependents.

File typescript CoreRuntime Instance 2 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  743bc9d4_d95b_7ea4_46fa_7835cd4a76de["resolve-scoped-slots.ts"]
  81ed4f13_7d68_6e21_7425_cf978f68576f["vnode"]
  743bc9d4_d95b_7ea4_46fa_7835cd4a76de --> 81ed4f13_7d68_6e21_7425_cf978f68576f
  8a5fb776_a8f4_ce8a_8549_67af07f2e1e9["util"]
  743bc9d4_d95b_7ea4_46fa_7835cd4a76de --> 8a5fb776_a8f4_ce8a_8549_67af07f2e1e9
  8456d994_c5db_04c1_7466_74c5274c4133["index.ts"]
  8456d994_c5db_04c1_7466_74c5274c4133 --> 743bc9d4_d95b_7ea4_46fa_7835cd4a76de
  style 743bc9d4_d95b_7ea4_46fa_7835cd4a76de fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { ScopedSlotsData } from 'types/vnode'
import { isArray } from 'core/util'

export function resolveScopedSlots(
  fns: ScopedSlotsData,
  res?: Record<string, any>,
  // the following are added in 2.6
  hasDynamicKeys?: boolean,
  contentHashKey?: number
): { $stable: boolean } & { [key: string]: Function } {
  res = res || { $stable: !hasDynamicKeys }
  for (let i = 0; i < fns.length; i++) {
    const slot = fns[i]
    if (isArray(slot)) {
      resolveScopedSlots(slot, res, hasDynamicKeys)
    } else if (slot) {
      // marker for reverse proxying v-slot without scope on this.$slots
      // @ts-expect-error
      if (slot.proxy) {
        // @ts-expect-error
        slot.fn.proxy = true
      }
      res[slot.key] = slot.fn
    }
  }
  if (contentHashKey) {
    ;(res as any).$key = contentHashKey
  }
  return res as any
}

Domain

Subdomains

Dependencies

  • util
  • vnode

Frequently Asked Questions

What does resolve-scoped-slots.ts do?
resolve-scoped-slots.ts is a source file in the vue codebase, written in typescript. It belongs to the CoreRuntime domain, Instance subdomain.
What functions are defined in resolve-scoped-slots.ts?
resolve-scoped-slots.ts defines 1 function(s): resolveScopedSlots.
What does resolve-scoped-slots.ts depend on?
resolve-scoped-slots.ts imports 2 module(s): util, vnode.
What files import resolve-scoped-slots.ts?
resolve-scoped-slots.ts is imported by 1 file(s): index.ts.
Where is resolve-scoped-slots.ts in the architecture?
resolve-scoped-slots.ts is located at src/core/instance/render-helpers/resolve-scoped-slots.ts (domain: CoreRuntime, subdomain: Instance, directory: src/core/instance/render-helpers).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free