MCPcopy
hub / github.com/vuejs/composition-api / resolveSlots

Function resolveSlots

src/utils/helper.ts:57–84  ·  view source on GitHub ↗
(
  slots: { [key: string]: Function } | void,
  normalSlots: { [key: string]: VNode[] | undefined }
)

Source from the content-addressed store, hash-verified

55}
56
57export function resolveSlots(
58 slots: { [key: string]: Function } | void,
59 normalSlots: { [key: string]: VNode[] | undefined }
60): { [key: string]: true } {
61 let res: { [key: string]: true }
62 if (!slots) {
63 res = {}
64 } else if (slots._normalized) {
65 // fast path 1: child component re-render only, parent did not change
66 return slots._normalized as any
67 } else {
68 res = {}
69 for (const key in slots) {
70 if (slots[key] && key[0] !== '$') {
71 res[key] = true
72 }
73 }
74 }
75
76 // expose normal slots on scopedSlots
77 for (const key in normalSlots) {
78 if (!(key in res)) {
79 res[key] = true
80 }
81 }
82
83 return res
84}
85
86let vueInternalClasses:
87 | {

Callers 1

resolveScopedSlotsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…