]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: compatible with vue@2.7 (#1541)
authorjiangfei <jiangfei5945@gmail.com>
Thu, 11 Aug 2022 09:39:59 +0000 (17:39 +0800)
committerGitHub <noreply@github.com>
Thu, 11 Aug 2022 09:39:59 +0000 (11:39 +0200)
Co-authored-by: jiangfei03 <jiangfei03@daojia-inc.com>
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/cookbook/options-api.md
packages/docs/core-concepts/plugins.md

index bfe373ea30e5021174293cbc376e405a23fed240..6c352f725691c42945a7a8e6deee4b4963d28a2a 100644 (file)
@@ -1,6 +1,6 @@
 # Usage without `setup()`
 
-Pinia can be used even if you are not using the composition API (if you are using Vue 2, you still need to install the `@vue/composition-api` plugin though). While we recommend you to give the Composition API a try and learn it, it might not be the time for you and your team yet, you might be in the process of migrating an application, or any other reason. There are a few functions:
+Pinia can be used even if you are not using the composition API (if you are using Vue <2.7, you still need to install the `@vue/composition-api` plugin though). While we recommend you give the Composition API a try and learn it, it might not be the time for you and your team yet, you might be in the process of migrating an application, or any other reason. There are a few functions:
 
 - [mapStores](#giving-access-to-the-whole-store)
 - [mapState](../core-concepts/state.md#usage-with-the-options-api)
index 3a7125edc221b83929e1990c5b48a9843efbe0e4..8594ad84a9896e93a7889aaf27e731660a7e0f90 100644 (file)
@@ -139,7 +139,7 @@ pinia.use(({ store }) => {
 Note that state changes or additions that occur within a plugin (that includes calling `store.$patch()`) happen before the store is active and therefore **do not trigger any subscriptions**.
 
 :::warning
-If you are using **Vue 2**, Pinia is subject to the [same reactivity caveats](https://vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats) as Vue. You will need to use `set` from `@vue/composition-api` when creating new state properties like `secret` and `hasError`:
+If you are using **Vue 2**, Pinia is subject to the [same reactivity caveats](https://vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats) as Vue. You will need to use `Vue.set()` (Vue 2.7) or `set()` (from `@vue/composition-api` for Vue <2.7) for when creating new state properties like `secret` and `hasError`:
 
 ```js
 import { set, toRef } from '@vue/composition-api'