docs: provide example of exposing a pageRef from a child page (#26806)

This commit is contained in:
Edwin Fadul 2024-04-17 04:26:40 -05:00 committed by GitHub
parent 8feb5fe5a4
commit 9119475db2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,6 +86,18 @@ function logFoo () {
</template> </template>
```` ````
````vue [my-page.vue]
<script setup lang="ts">
const foo = () => {
console.log('foo method called')
}
defineExpose({
foo,
})
</script>
````
## Custom Props ## Custom Props
In addition, `<NuxtPage>` also accepts custom props that you may need to pass further down the hierarchy. In addition, `<NuxtPage>` also accepts custom props that you may need to pass further down the hierarchy.