Skip to content

Commit

Permalink
docs: provide example of passing props to a child page (#26805)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinfadul committed Apr 17, 2024
1 parent bde696a commit 8feb5fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,14 @@ 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)
</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

0 comments on commit 8feb5fe

Please sign in to comment.