mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +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(() => {
|
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>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user