Nuxt/test/fixtures/basic/pages/useAsyncData/nuxt-data.vue

16 lines
314 B
Vue
Raw Normal View History

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