Nuxt/test/fixtures/basic/pages/preview/with-use-fetch.vue
2024-03-06 17:14:15 +00:00

26 lines
400 B
Vue

<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>