We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
$nuxt
1 parent 4716b5e commit df75778Copy full SHA for df75778
nuxt/plugin.js
@@ -20,8 +20,10 @@ const myPlugin = (context, inject) => {
20
setActivePinia(pinia)
21
22
// we bypass warnings
23
- // @ts-expect-error
24
- pinia._p.push(() => ({ $nuxt: context }))
+ pinia._p.push(({ store }) => {
+ // non enumerable to avoid it being serialized or displayed in devtools
25
+ Object.defineProperty(store, '$nuxt', { value: context })
26
+ })
27
28
if (process.server) {
29
context.beforeNuxtRender(({ nuxtState }) => {
0 commit comments