Add remix-like loaders and actions to your Nuxt page components.
Warning
This project is experimental. The APIs are subject to change without notice. Proceed with caution.
<script lang="ts">
import { prisma } from '@/lib/prisma.server'
export async function loader() {
const products = await prisma.product.findMany()
return products
}
</script>
<script setup lang="ts">
const { data } = await useLoaderData<typeof loader>()
</script>
<template>
<div>
<h1>Products</h1>
<div v-for="product in data" :key="product.id">
{{ product.name }}
</div>
</div>
</template>
For documentation about Numix please visit https://numix.vercel.app.
- Run
cp playground/.env.example playground/.env
- Run
pnpm dev:prepare
to generate type stubs. - Run
pnpm db:prepare
to generate fake data. - Use
pnpm dev
to start playground in development mode.
MIT