Ferdinand
Ferdinand

Reputation: 21

How to use a dynamic path with Nuxt-Content?

I'm trying to display a document of a Nuxt-Content folder with a dynamic path :

<script setup lang="ts">
const n = ref(1)
</script>

<template>
  <div>
    <ContentDoc 
      v-slot="{ doc }"
      :path="'collection/' + n" 
    >
      <ContentRenderer :value="doc" />
    </ContentDoc>
    <div @click="n++">
      Click-me !
    </div>
  </div>
</template>

It's working perfectly fine in development, however after deploying the application (with nuxt generate) on Netlify, the document is never found after the click event.

Does someone know why it is happening and how to make it work?

Thanks a lot

Upvotes: 1

Views: 137

Answers (0)

Related Questions