From the parent component, you pass some values to the child component, using a colon followed by the name you want to access with in the child component.
On the parent component, say pages/index.vue:
<template>
<div>
<div v-for="review in reviews">
<SingleReview :review="review" :key="review._id" />
</div>
</div>
</template>
In this case, we pass each review object to the child with the name review.
On the child component named components/singleReview.vue:
<script setup>
const props = defineProps({
review: {
type: Object,
required: true,
},
});
const { review } = props;
</script>
And we access each review prop in the child component using the same name.
See a working replication
Answer from learntheropes on Stack Overflownuxt.js - How to pass props to component pages - Stack Overflow
Passing props to page / layout using nuxt-link and props: true
Pass props to nuxt component (or page)
nuxt.js -> v-bind to props of <nuxt>
Videos
you have to use camelCase in JavaScript part
<script>
export default {
props: [
'basketCount'
]
}
</script>
To pass data between components of page, another way is to use a Vuex Store https://nuxtjs.org/guide/vuex-store/
Use NuxtChild or router-view
Just Use NuxtChild instead of Nuxt and you can directly pass everything to the pages/compnents that are loaded. Docs
so in layout do something like this
<div id="app">
<Header />
<SocialMedia />
<main>
<NuxtChild :myPropNameHere="prop data here" />
</main>
<Aside />
</div>
or like this
so in layout do something like this
<div id="app">
<Header />
<SocialMedia />
<main>
<router-view :myPropNameHere="prop data here" />
</main>
<Aside />
</div>
Note : I have noticed that NuxtChild and Nuxt are working slower than router-view in my case, but using router-view might cause some Nuxt features to not work, so it's up to you to decide what to use.