createSetupContext() — vue Function Reference
Architecture documentation for the createSetupContext() function in apiSetup.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 90e994f6_eac7_d182_0e97_d5a116aca32a["createSetupContext()"] 4ad51b1f_61ec_31ba_dbb7_667d6a0a8c85["apiSetup.ts"] 90e994f6_eac7_d182_0e97_d5a116aca32a -->|defined in| 4ad51b1f_61ec_31ba_dbb7_667d6a0a8c85 68e41397_5a92_5b2b_c03f_8a2d186bd3a6["initSetup()"] 68e41397_5a92_5b2b_c03f_8a2d186bd3a6 -->|calls| 90e994f6_eac7_d182_0e97_d5a116aca32a f0e53308_3ebc_8af6_4759_f599ee684ba5["getContext()"] f0e53308_3ebc_8af6_4759_f599ee684ba5 -->|calls| 90e994f6_eac7_d182_0e97_d5a116aca32a e80cd6c8_61be_e079_e6c9_8ffe8e330e6d["syncSetupProxy()"] 90e994f6_eac7_d182_0e97_d5a116aca32a -->|calls| e80cd6c8_61be_e079_e6c9_8ffe8e330e6d c78c0d63_44e7_97ac_6bcb_8876594cebbf["initSlotsProxy()"] 90e994f6_eac7_d182_0e97_d5a116aca32a -->|calls| c78c0d63_44e7_97ac_6bcb_8876594cebbf f813e3f0_a8fa_7690_027d_8675e5e0c8e0["proxyWithRefUnwrap()"] 90e994f6_eac7_d182_0e97_d5a116aca32a -->|calls| f813e3f0_a8fa_7690_027d_8675e5e0c8e0 style 90e994f6_eac7_d182_0e97_d5a116aca32a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/v3/apiSetup.ts lines 87–123
function createSetupContext(vm: Component): SetupContext {
let exposeCalled = false
return {
get attrs() {
if (!vm._attrsProxy) {
const proxy = (vm._attrsProxy = {})
def(proxy, '_v_attr_proxy', true)
syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs')
}
return vm._attrsProxy
},
get listeners() {
if (!vm._listenersProxy) {
const proxy = (vm._listenersProxy = {})
syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners')
}
return vm._listenersProxy
},
get slots() {
return initSlotsProxy(vm)
},
emit: bind(vm.$emit, vm) as any,
expose(exposed?: Record<string, any>) {
if (__DEV__) {
if (exposeCalled) {
warn(`expose() should be called only once per setup().`, vm)
}
exposeCalled = true
}
if (exposed) {
Object.keys(exposed).forEach(key =>
proxyWithRefUnwrap(vm, exposed, key)
)
}
}
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does createSetupContext() do?
createSetupContext() is a function in the vue codebase, defined in src/v3/apiSetup.ts.
Where is createSetupContext() defined?
createSetupContext() is defined in src/v3/apiSetup.ts at line 87.
What does createSetupContext() call?
createSetupContext() calls 3 function(s): initSlotsProxy, proxyWithRefUnwrap, syncSetupProxy.
What calls createSetupContext()?
createSetupContext() is called by 2 function(s): getContext, initSetup.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free