baked-recipe-admin
Version:
Baked is an opinionated framework for .NET in backend and Nuxt in frontend. This is a recipe package that brings together all the components one needs for an Admin UI.
22 lines (17 loc) • 381 B
JavaScript
import { createError, useNuxtApp } from "#app";
export default function() {
const { $layouts } = useNuxtApp();
async function fetch(name) {
if(!$layouts[name]) {
throw createError({
statusCode: 404,
statusMessage: `'${name}' Layout Not Found`,
fatal: true
});
}
return await $layouts[name]();
}
return {
fetch
};
}