Home / Function/ getContext() — vue Function Reference

getContext() — vue Function Reference

Architecture documentation for the getContext() function in apiSetup.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  a9fff689_3261_6c15_1afe_9ac9a797d119["getContext()"]
  93d953cd_3fdd_64b8_3559_41671949021b["useSlots()"]
  93d953cd_3fdd_64b8_3559_41671949021b -->|calls| a9fff689_3261_6c15_1afe_9ac9a797d119
  6e6ebbeb_11ed_4ce2_27ee_2f5e90cf9916["useAttrs()"]
  6e6ebbeb_11ed_4ce2_27ee_2f5e90cf9916 -->|calls| a9fff689_3261_6c15_1afe_9ac9a797d119
  5e98d3c4_bfd7_6fad_1ba3_79a8dfbd84d2["useListeners()"]
  5e98d3c4_bfd7_6fad_1ba3_79a8dfbd84d2 -->|calls| a9fff689_3261_6c15_1afe_9ac9a797d119
  6827e187_9a52_5423_0fdc_05675ae269f2["createSetupContext()"]
  a9fff689_3261_6c15_1afe_9ac9a797d119 -->|calls| 6827e187_9a52_5423_0fdc_05675ae269f2
  style a9fff689_3261_6c15_1afe_9ac9a797d119 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/apiSetup.ts lines 208–214

function getContext(): SetupContext {
  if (__DEV__ && !currentInstance) {
    warn(`useContext() called without active instance.`)
  }
  const vm = currentInstance!
  return vm._setupContext || (vm._setupContext = createSetupContext(vm))
}

Domain

Subdomains

Frequently Asked Questions

What does getContext() do?
getContext() is a function in the vue codebase.
What does getContext() call?
getContext() calls 1 function(s): createSetupContext.
What calls getContext()?
getContext() is called by 3 function(s): useAttrs, useListeners, useSlots.

Analyze Your Own Codebase

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

Try Supermodel Free