UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

25 lines (24 loc) 711 B
import { createVNode, defineComponent, onErrorCaptured } from "vue"; import { createError } from "../composables/error.js"; import { islandComponents } from "#build/components.islands.mjs"; export default defineComponent({ props: { context: { type: Object, required: true } }, setup(props) { const component = islandComponents[props.context.name]; if (!component) { throw createError({ statusCode: 404, statusMessage: `Island component not found: ${props.context.name}` }); } onErrorCaptured((e) => { console.log(e); }); return () => createVNode(component || "span", { ...props.context.props, "data-island-uid": "" }); } });