<template>
  <div>
    <div v-if="toto">
      <h1>#{{route.params.id }} / {{ toto.title }}</h1>
      <p>{{ toto.body }}</p>
    </div>
    <div v-else>
      <p>Chargement...</p>
    </div>

  </div>
</template>

<script setup>
  const route = useRoute()
  const {data: toto} = await useFetch(() => 'https://jsonplaceholder.typicode.com/posts/' + route.params.id, { lazy: true })
  useSeoMeta({
    title: () => toto.value?.title
  })
</script>

<style>

</style>