Co-authored-by: liuyao <liuyao@liuyaodeiMac.local>
Create a pinia instance (the root store) and pass it to the app as a plugin:
-```js{2,5-6,8}
+```js {2,5-6,8}
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
If you are using Vue 2, you also need to install a plugin and inject the created `pinia` at the root of the app:
-```js{1,3-4,12}
+```js {1,3-4,12}
import { createPinia, PiniaVuePlugin } from 'pinia'
Vue.use(PiniaVuePlugin)
If you are still not into `setup()` and Composition API, don't worry, Pinia also support a similar set of [_map helpers_ like Vuex](https://vuex.vuejs.org/guide/state.html#the-mapstate-helper). You define stores the same way but then use `mapStores()`, `mapState()`, or `mapActions()`:
-```js{22,24,28}
+```js {22,24,28}
const useCounterStore = defineStore('counter', {
state: () => ({ count: 0 }),
getters: {