mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
docs: update plugin provide example (#5386)
This commit is contained in:
parent
1449e70541
commit
ba4f2f0d4f
@ -47,7 +47,7 @@ If you would like to provide a helper on the `NuxtApp` instance, return it from
|
||||
export default defineNuxtPlugin(() => {
|
||||
return {
|
||||
provide: {
|
||||
hello: () => 'world'
|
||||
hello: (msg: string) => `Hello ${msg}!`
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -58,7 +58,7 @@ In another file you can use this:
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
{{ $hello() }}
|
||||
{{ $hello('world') }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user