]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: migration v1 nuxt
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 20 Aug 2021 15:23:46 +0000 (17:23 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 20 Aug 2021 15:23:46 +0000 (17:23 +0200)
packages/docs/cookbook/migration-v1-v2.md

index 0a00472b5b35febb3053775fbcf4e073e5007e6c..ea234d371f17fc63c76fb328e76d60128435a46f 100644 (file)
@@ -71,3 +71,39 @@ yarn add @vue/composition-api@latest
 ## Devtools
 
 Pinia v2 no longer hijacks Vue Devtools v5, it requires Vue Devtools v6. Find the download link on the [Vue Devtools documentation](https://devtools.vuejs.org/guide/installation.html#chrome) for the **beta channel** of the extension.
+
+## Nuxt
+
+If you are using Nuxt, pinia has now it's dedicated Nuxt package ðŸŽ‰. Install it with:
+
+```shell
+npm i @pinia/nuxt
+# or with yarn
+yarn add @pinia/nuxt
+```
+
+Also make sure to **update your `@nuxtjs/composition-api` package**.
+
+Then adapt your `nuxt.config.js` and your `tsconfig.json` if you are using TypeScript:
+
+```diff
+ // nuxt.config.js
+ module.exports {
+   buildModules: [
+     '@nuxtjs/composition-api/module',
+-    'pinia/nuxt',
++    '@pinia/nuxt',
+   ],
+ }
+```
+
+```diff
+ // tsconfig.json
+ {
+   "types": [
+     // ...
+-    "pinia/nuxt/types"
++    "@pinia/nuxt"
+   ]
+ }
+```