]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: imports missing (#2636)
authorHussain Panahy <144150970+HP8585@users.noreply.github.com>
Tue, 16 Apr 2024 16:01:39 +0000 (19:31 +0330)
committerGitHub <noreply@github.com>
Tue, 16 Apr 2024 16:01:39 +0000 (18:01 +0200)
* Update index.md

hey brother, you forgot to import define store from pinia and also computed from vue, with all due respect, apologize for the yesterday I just wanna help to make the pinia package perfect and seamless !!

* Update packages/docs/core-concepts/index.md [skip ci]

* Update packages/docs/core-concepts/index.md [skip ci]

* Update packages/docs/core-concepts/index.md [skip ci]

---------

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/core-concepts/index.md

index d414568e25226be3fffeec6745d767f795963feb..01d458ccb96e70591613a7e333867ddbf1f185e4 100644 (file)
@@ -77,6 +77,7 @@ Setup stores are also able to rely on globally _provided_ properties like the Ro
 ```ts
 import { inject } from 'vue'
 import { useRoute } from 'vue-router'
+import { defineStore } from 'pinia'
 
 export const useSearchFilters = defineStore('search-filters', () => {
   const route = useRoute()
@@ -125,6 +126,8 @@ Note that `store` is an object wrapped with `reactive`, meaning there is no need
 ```vue
 <script setup>
 import { useCounterStore } from '@/stores/counter'
+import { computed } from 'vue'
+
 const store = useCounterStore()
 // ❌ This won't work because it breaks reactivity
 // it's the same as destructuring from `props`