docs: update plugin provide example (#5386)

This commit is contained in:
Zalexios 2022-06-10 10:28:17 -04:00 committed by GitHub
parent 1449e70541
commit ba4f2f0d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ If you would like to provide a helper on the `NuxtApp` instance, return it from
export default defineNuxtPlugin(() => { export default defineNuxtPlugin(() => {
return { return {
provide: { provide: {
hello: () => 'world' hello: (msg: string) => `Hello ${msg}!`
} }
} }
}) })
@ -58,7 +58,7 @@ In another file you can use this:
```vue ```vue
<template> <template>
<div> <div>
{{ $hello() }} {{ $hello('world') }}
</div> </div>
</template> </template>