MCPcopy
hub / github.com/vuejs/core / get

Function get

packages/runtime-core/src/compat/props.ts:18–40  ·  view source on GitHub ↗
(_, key: string)

Source from the content-addressed store, hash-verified

16 {},
17 {
18 get(_, key: string) {
19 __DEV__ &&
20 warnDeprecation(DeprecationTypes.PROPS_DEFAULT_THIS, null, propKey)
21 // $options
22 if (key === '$options') {
23 return resolveMergedOptions(instance)
24 }
25 // props
26 if (key in rawProps) {
27 return rawProps[key]
28 }
29 // injections
30 const injections = (instance.type as ComponentOptions).inject
31 if (injections) {
32 if (isArray(injections)) {
33 if (injections.includes(key)) {
34 return inject(key)
35 }
36 } else if (key in injections) {
37 return inject(key)
38 }
39 }
40 },
41 },
42 )
43}

Callers

nothing calls this directly

Calls 3

warnDeprecationFunction · 0.90
resolveMergedOptionsFunction · 0.90
injectFunction · 0.90

Tested by

no test coverage detected