Nuxt/test/fixtures/basic/pages/useAsyncData/nuxt-data.vue
2024-02-14 21:27:37 +05:45

16 lines
314 B
Vue

<template>
<div
v-if="status !== 'pending'"
v-text="'resolved:' + data.resolved"
/>
<div
v-else
v-text="'loading'"
/>
</template>
<script setup>
useNuxtData('call')
const { data, status } = await useAsyncData('call', () => Promise.resolve({ resolved: true }), { server: false })
</script>