From: Eduardo San Martin Morote Date: Wed, 29 Sep 2021 12:28:11 +0000 (+0200) Subject: docs: display migration guide v1 X-Git-Tag: pinia@2.0.0-rc.10~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8462c71a3e17a6fbf14c3150d74149feb6ff7ea;p=thirdparty%2Fvuejs%2Fpinia.git docs: display migration guide v1 --- diff --git a/packages/docs/.vitepress/config.js b/packages/docs/.vitepress/config.js index 04ad8297..8e013399 100644 --- a/packages/docs/.vitepress/config.js +++ b/packages/docs/.vitepress/config.js @@ -234,8 +234,8 @@ module.exports = { link: '/cookbook/composing-stores.html', }, { - text: 'Migration from 0.0.7', - link: '/cookbook/migration-0-0-7.html', + text: 'Migration from v0/v1 to v2', + link: '/cookbook/migration-v1-v2.html', }, ], }, diff --git a/packages/docs/cookbook/migration-0-0-7.md b/packages/docs/cookbook/migration-0-0-7.md index 9b024c0e..f5533753 100644 --- a/packages/docs/cookbook/migration-0-0-7.md +++ b/packages/docs/cookbook/migration-0-0-7.md @@ -60,10 +60,10 @@ If you are using Vue 2 (Pinia <= 1): ```js import Vue from 'vue' -import { createPinia, PiniaPlugin } from 'pinia' +import { createPinia, PiniaVuePlugin } from 'pinia' const pinia = createPinia() -Vue.use(PiniaPlugin) +Vue.use(PiniaVuePlugin) new Vue({ el: '#app', pinia, @@ -75,7 +75,7 @@ If you are using Vue 3 (Pinia >= 2): ```js import { createApp } from 'vue' -import { createPinia, PiniaPlugin } from 'pinia' +import { createPinia, PiniaVuePlugin } from 'pinia' import App from './App.vue' const pinia = createPinia() @@ -94,12 +94,12 @@ If you are using Vue 2 (Pinia <= 1): ```diff // entry-server.js -import { getRootState, PiniaSsr } from 'pinia', -+import { createPinia, PiniaPlugin } from 'pinia', ++import { createPinia, PiniaVuePlugin } from 'pinia', -// install plugin to automatically use correct context in setup and onServerPrefetch -Vue.use(PiniaSsr); -+Vue.use(PiniaPlugin) ++Vue.use(PiniaVuePlugin) export default context => { + const pinia = createPinia()