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

Function setup

test/apis/computed.spec.js:20–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 const vm = new Vue({
19 template: '<div>{{ b }}</div>',
20 setup() {
21 const a = ref(1)
22 const b = computed(() => a.value + 1)
23 return {
24 a,
25 b,
26 }
27 },
28 }).$mount()
29 expect(vm.b).toBe(2)
30 expect(vm.$el.textContent).toBe('2')

Callers

nothing calls this directly

Calls 4

refFunction · 0.90
computedFunction · 0.90
reactiveFunction · 0.90
toRefFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…