Data Fetching
This example demonstrates data fetching with Nuxt using built-in composables and API routes.
index.vue
Open docs<script setup>
const { data } = await useFetch('/api/hello')
</script>
<template>
<div>
<p>
Result of <UKbd
size="lg"
value="/api/hello"
/>:
</p>
<pre>{{ data }}</pre>
</div>
</template>