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.

Entity Profile

Dependency Diagram

graph TD
  c7f1d55d_2699_9c30_8e7e_777b218e0242["normalizeScopedSlot()"]
  7f59d675_8a0c_03b6_a7a6_985942631eb0["normalizeScopedSlots()"]
  7f59d675_8a0c_03b6_a7a6_985942631eb0 -->|calls| c7f1d55d_2699_9c30_8e7e_777b218e0242
  f6cc67da_03fd_cbe1_8ffb_6aaf0358d6ae["setCurrentInstance()"]
  c7f1d55d_2699_9c30_8e7e_777b218e0242 -->|calls| f6cc67da_03fd_cbe1_8ffb_6aaf0358d6ae
  5622921f_54b9_3c35_daaf_e1a5562f01a0["normalizeChildren()"]
  c7f1d55d_2699_9c30_8e7e_777b218e0242 -->|calls| 5622921f_54b9_3c35_daaf_e1a5562f01a0
  bf71a2ee_f51c_e994_6426_9bfe8fe12600["isAsyncPlaceholder()"]
  c7f1d55d_2699_9c30_8e7e_777b218e0242 -->|calls| bf71a2ee_f51c_e994_6426_9bfe8fe12600
  style c7f1d55d_2699_9c30_8e7e_777b218e0242 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.
What does normalizeScopedSlot() call?
normalizeScopedSlot() calls 3 function(s): isAsyncPlaceholder, normalizeChildren, setCurrentInstance.
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