如何在Nuxt3中生成静态页面时才能获得数据。生成后,数据应存储在源代码中,即用获取的对象替换fetch命令。在Nuxt3中这是怎么可能的?
<template>
<main>
{{ page.content }
</main>
</template>
<script setup>
const { data: page } = await useFetch(`http://api.example/pages/index`, { headers: { 'api-key': api.key }});
</script>发布于 2022-11-18 23:25:05
https://stackoverflow.com/questions/74494379
复制相似问题