Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/repro-hmr-composition-api.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132<template> <nuxt-content :document="doc" /></template>
<script lang="ts">import { defineComponent, useContext, useAsync, onServerPrefetch, computed, onMounted} from "nuxt-composition-api";
export default defineComponent({ setup() { const { $content, params } = useContext(); const fetchContent = () => { return $content(params.value.slug || "index").fetch(); };
const doc = useAsync(fetchContent); onServerPrefetch(async () => { doc.value = await fetchContent(); });
return { doc }; }});</script>