From e887bfd7254fe02b5e5cd39d2d6a3dfe1b8b7250 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 28 Mar 2024 15:07:33 +0100 Subject: [PATCH] docs: fixes --- packages/docs/core-concepts/plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docs/core-concepts/plugins.md b/packages/docs/core-concepts/plugins.md index 0f1efdc9..680315dc 100644 --- a/packages/docs/core-concepts/plugins.md +++ b/packages/docs/core-concepts/plugins.md @@ -117,7 +117,7 @@ import { toRef, ref } from 'vue' pinia.use(({ store }) => { // to correctly handle SSR, we need to make sure we are not overriding an // existing value - if (!Object.prototype.hasOwnProperty(store.$state, 'hasError')) { + if (!store.$state.hasOwnProperty('hasError')) { // hasError is defined within the plugin, so each store has their individual // state property const hasError = ref(false) @@ -144,7 +144,7 @@ If you are using **Vue 2**, Pinia is subject to the [same reactivity caveats](ht ```js import { set, toRef } from '@vue/composition-api' pinia.use(({ store }) => { - if (!Object.prototype.hasOwnProperty(store.$state, 'secret')) { + if (!store.$state.hasOwnProperty('secret')) { const secretRef = ref('secret') // If the data is meant to be used during SSR, you should // set it on the `$state` property so it is serialized and @@ -169,7 +169,7 @@ import { toRef, ref } from 'vue' pinia.use(({ store }) => { // this is the same code as above for reference - if (!Object.prototype.hasOwnProperty(store.$state, 'hasError')) { + if (!store.$state.hasOwnProperty('hasError')) { const hasError = ref(false) store.$state.hasError = hasError } -- 2.47.2