Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vssue]Nuxt 3 and Pinia #23

Open
CodyBontecou opened this issue Feb 17, 2022 · 5 comments
Open

[Vssue]Nuxt 3 and Pinia #23

CodyBontecou opened this issue Feb 17, 2022 · 5 comments
Labels

Comments

@CodyBontecou
Copy link
Owner

https://codybontecou.com/nuxt3-and-pinia.html

@ddddeano
Copy link

just wondering why there is an ID of ”filter-store“ but it is never used

@CodyBontecou
Copy link
Owner Author

just wondering why there is an ID of ”filter-store“ but it is never used

Hey @ddddeano.

The defineStore function requires an id parameter. In their docs, they implicitly add it like so:

export const useStore = defineStore('main', {
  // other options...
})

But I prefer to be more explicit.

Pinia states in their docs This name, also referred as id, is necessary and is used by Pinia to connect the store to the devtools..

So it sounds like this id is how they manage the UX within the devtools. You can read more about it in their docs if you're curious.

@lucasctd
Copy link

lucasctd commented Apr 3, 2022

Hi Buddy, first of all, thanks for your article.
I am just wondering, can I use Nuxt State (https://v3.nuxtjs.org/docs/usage/state/) instead of Pinia? I see it has similar features (like sharing data across components).

@CodyBontecou
Copy link
Owner Author

Hi Buddy, first of all, thanks for your article. I am just wondering, can I use Nuxt State (https://v3.nuxtjs.org/docs/usage/state/) instead of Pinia? I see it has similar features (like sharing data across components).

Hey hey. Glad you enjoyed the article. As for useState, I'll dig in a bit more and let you know what I find!

@phillipmohr
Copy link

How to use pinia within the API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants