]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(nuxt): inject Vue before rendering
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 5 May 2021 11:50:40 +0000 (13:50 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 5 May 2021 11:50:43 +0000 (13:50 +0200)
Fix #473

nuxt/plugin.js

index 3b7a954ae9dc2d4f2ca075fa6980694cf7ec024a..cfbc890a170880d9ab8ba48799052d191bb76a4f 100644 (file)
@@ -12,6 +12,8 @@ const myPlugin = (context, inject) => {
 
   /** @type {import('../src').Pinia} */
   const pinia = createPinia()
+  // nuxt plugins can run before Pinia has retrieved the Vue instance
+  pinia.Vue = Vue
   inject('pinia', pinia)
   // simulate the injection ofr `new Vue({ pinia })`
   context.app.pinia = pinia