From bb63dd2aae8fec9fe3bffcce574866f6192f9bc3 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 10 Oct 2022 22:52:15 +0200 Subject: [PATCH] docs: plugin in nuxt --- packages/docs/core-concepts/plugins.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/docs/core-concepts/plugins.md b/packages/docs/core-concepts/plugins.md index 9513eb16..f8e46d3c 100644 --- a/packages/docs/core-concepts/plugins.md +++ b/packages/docs/core-concepts/plugins.md @@ -366,7 +366,7 @@ There is also a `StoreGetters` type to extract the _getters_ from a Store type. When [using pinia alongside Nuxt](../ssr/nuxt.md), you will have to create a [Nuxt plugin](https://nuxtjs.org/docs/2.x/directory-structure/plugins) first. This will give you access to the `pinia` instance: ```ts -// plugins/myPiniaPlugin.js +// plugins/myPiniaPlugin.ts import { PiniaPluginContext } from 'pinia' function MyPiniaPlugin({ store }: PiniaPluginContext) { @@ -388,8 +388,10 @@ Note the above example is using TypeScript, you have to remove the type annotati ### Nuxt.js 2 +If you are using Nuxt.js 2, the types are slightly different: + ```ts -// plugins/myPiniaPlugin.js +// plugins/myPiniaPlugin.ts import { PiniaPluginContext } from 'pinia' import { Plugin } from '@nuxt/types' -- 2.47.2