Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improvement in nuxtPages documentation when passing parameters to child pages #26805

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/2.guide/2.directory-structure/1.pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ To display the `child.vue` component, you have to insert the `<NuxtPage>` compon
</template>
```

```vue {}[pages/child.vue]
<script setup lang="ts">
const props = defineProps(['foobar'])

console.log(props.foobar);
danielroe marked this conversation as resolved.
Show resolved Hide resolved

danielroe marked this conversation as resolved.
Show resolved Hide resolved
</script>
```

### Child Route Keys

If you want more control over when the `<NuxtPage>` component is re-rendered (for example, for transitions), you can either pass a string or function via the `pageKey` prop, or you can define a `key` value via `definePageMeta`:
Expand Down