Nuxt/test/fixtures/basic/pages/preview/with-use-fetch.vue

26 lines
402 B
Vue
Raw Permalink Normal View History

<script setup>
const { enabled, state } = usePreviewMode()
const { data } = await useFetch('/api/preview', {
query: {
apiKey: state.token || undefined,
},
})
</script>
<template>
<div>
<p id="enabled">
{{ enabled }}
</p>
<p id="token-check">
{{ state.token }}
</p>
<p id="correct-api-key-check">
{{ data && data.hehe }}
</p>
</div>
</template>