Home / Function/ normalizeScopedSlot() — vue Function Reference

normalizeScopedSlot() — vue Function Reference

Architecture documentation for the normalizeScopedSlot() function in normalize-scoped-slots.ts from the vue codebase.

Function typescript VueCore Observer calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  1b52839f_58e1_4d85_bfad_8c56ba11960f["normalizeScopedSlot()"]
  091d06a8_6793_746a_7499_d22a1d025196["normalize-scoped-slots.ts"]
  1b52839f_58e1_4d85_bfad_8c56ba11960f -->|defined in| 091d06a8_6793_746a_7499_d22a1d025196
  e490d83e_fe82_d38d_a362_5157771a3160["normalizeScopedSlots()"]
  e490d83e_fe82_d38d_a362_5157771a3160 -->|calls| 1b52839f_58e1_4d85_bfad_8c56ba11960f
  9e2d427b_d4a2_bb4c_370b_b1726419786d["isAsyncPlaceholder()"]
  1b52839f_58e1_4d85_bfad_8c56ba11960f -->|calls| 9e2d427b_d4a2_bb4c_370b_b1726419786d
  style 1b52839f_58e1_4d85_bfad_8c56ba11960f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/vdom/helpers/normalize-scoped-slots.ts lines 65–93

function normalizeScopedSlot(vm, normalSlots, key, fn) {
  const normalized = function () {
    const cur = currentInstance
    setCurrentInstance(vm)
    let res = arguments.length ? fn.apply(null, arguments) : fn({})
    res =
      res && typeof res === 'object' && !isArray(res)
        ? [res] // single vnode
        : normalizeChildren(res)
    const vnode: VNode | null = res && res[0]
    setCurrentInstance(cur)
    return res &&
      (!vnode ||
        (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
      ? undefined
      : res
  }
  // this is a slot using the new v-slot syntax without scope. although it is
  // compiled as a scoped slot, render fn users would expect it to be present
  // on this.$slots because the usage is semantically a normal slot.
  if (fn.proxy) {
    Object.defineProperty(normalSlots, key, {
      get: normalized,
      enumerable: true,
      configurable: true
    })
  }
  return normalized
}

Domain

Subdomains

Frequently Asked Questions

What does normalizeScopedSlot() do?
normalizeScopedSlot() is a function in the vue codebase, defined in src/core/vdom/helpers/normalize-scoped-slots.ts.
Where is normalizeScopedSlot() defined?
normalizeScopedSlot() is defined in src/core/vdom/helpers/normalize-scoped-slots.ts at line 65.
What does normalizeScopedSlot() call?
normalizeScopedSlot() calls 1 function(s): isAsyncPlaceholder.
What calls normalizeScopedSlot()?
normalizeScopedSlot() is called by 1 function(s): normalizeScopedSlots.

Analyze Your Own Codebase

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

Try Supermodel Free