Difficult to delineate between Composition API and Options API in Pinia docs #2070
Unanswered
timbuckiii
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm very familiar with Vue 2, Vue X and the Options API. Recently, I started a new project using Vue 3 (Nuxt 3 actually) and Pinia.
I'm trying to wrap my head around the canonical usage of the Composition API with Pinia, but find the docs very confusing.
For example, the Defining a Store page clearly distinguishes between how to create a store with composition (ie. setup) vs. options. It notes that refs become state. Then, on the very next page, State starts off with an example of creating a state object within the store, rather than using refs, with no mention of whether or not this is under the Composition API or Options API.
My assumption is that it's an example of creating state while using the Options API (ie. non-setup approach), but even more confusingly there's a section lower on the same page that's focused on usage with the Options API, which makes me second guess myself. This confusion further compounds with each additional page (getters, actions, etc.).
My perception is that there's a lack of delineation in the docs between usage with the Composition API vs. the Options API.
Can someone please help me understand which sections of the docs relate to the canonical usage of the Composition API with Pinia?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions