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

Function setup

packages/runtime-core/__tests__/apiSetupContext.spec.ts:18–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 it('should expose return values to template render context', () => {
17 const Comp = defineComponent({
18 setup() {
19 return {
20 // ref should auto-unwrap
21 ref: ref('foo'),
22 // object exposed as-is
23 object: reactive({ msg: 'bar' }),
24 // primitive value exposed as-is
25 value: 'baz',
26 }
27 },
28 render() {
29 return `${this.ref} ${this.object.msg} ${this.value}`
30 },

Callers

nothing calls this directly

Calls 5

refFunction · 0.90
reactiveFunction · 0.90
hFunction · 0.85
watchEffectFunction · 0.85
emitFunction · 0.50

Tested by

no test coverage detected