MCPcopy
hub / github.com/nuxt/nuxt / setup

Function setup

packages/nuxt/src/components/runtime/server-component.ts:15–35  ·  view source on GitHub ↗
(props, { attrs, slots, expose, emit })

Source from the content-addressed store, hash-verified

13 props: { lazy: Boolean },
14 emits: ['error'],
15 setup (props, { attrs, slots, expose, emit }) {
16 const vm = getCurrentInstance()
17 const islandRef = ref<null | typeof NuxtIsland>(null)
18
19 expose({
20 refresh: () => islandRef.value?.refresh(),
21 })
22
23 return () => {
24 return h(NuxtIsland, {
25 name,
26 lazy: props.lazy,
27 props: attrs,
28 scopeId: vm?.vnode.scopeId,
29 ref: islandRef,
30 onError: (err) => {
31 emit('error', err)
32 },
33 }, slots)
34 }
35 },
36 })
37}
38

Callers

nothing calls this directly

Calls 6

useNuxtAppFunction · 0.90
useRouteFunction · 0.90
isPrerenderedFunction · 0.90
createErrorFunction · 0.90
showErrorFunction · 0.90
emitFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…