
Nuxt 3 Has Free Full-Stack Powers That Make Next.js Developers Jealous
Next.js has App Router complexity. Nuxt 3 has auto-imports, server routes, and zero-config — everything just works. Auto-Imports (Zero Import Statements) < script setup > // No imports needed! Nuxt auto-imports: // - Vue APIs (ref, computed, watch, onMounted) // - Nuxt composables (useRoute, useFetch, useState) // - Your components (from components/ directory) // - Your composables (from composables/ directory) // - Your utils (from utils/ directory) const count = ref ( 0 ) // ref is auto-imported const route = useRoute () // useRoute is auto-imported const { data } = await useFetch ( " /api/users " ) // useFetch is auto-imported </ script > Data Fetching < script setup > // SSR + client-side fetching with caching const { data : users , pending , error , refresh } = await useFetch ( " /api/users " , { query : { page : 1 }, transform : ( data ) => data . map ( u => ({ ... u , fullName : ` ${ u . first } ${ u . last } ` })), }); // Lazy loading (client-side only) const { data : stats } =
Continue reading on Dev.to Webdev
Opens in a new tab



