Capability
Other metadata
- metadata
{
"author": "Anthony Fu",
"version": "2026.9.25",
"source": "Generated from https://github.com/vuejs/pinia, scripts located at https://github.com/antfu/skills"
}
What it does
Pinia is the official Vue state management library providing type-safe, extensible stores with support for both Options and Composition APIs. Use it for defining reactive state, getters, and actions in Vue applications, with built-in TypeScript support and devtools integration.
Generated from the current SKILL.md.
Frequently asked
Does Pinia work with both Options API and Composition API?
Yes. Pinia supports both Options API and Composition API styles with first-class TypeScript support for both.
How do I preserve reactivity when destructuring state from a store?
Use `storeToRefs()` when destructuring state and getters to maintain reactivity. Actions can be destructured directly since they're bound to the store.
Can I use Pinia outside of Vue components?
Yes. Pinia stores work in navigation guards, plugins, middlewares, and other contexts outside components, but you should call stores inside functions rather than at module scope, especially for SSR.
How do I test components that use Pinia stores?
Use `@pinia/testing` for unit testing with built-in support for mocking and stubbing stores.
Does Pinia have Nuxt integration?
Yes. Pinia integrates with Nuxt with auto-imports, auto-setup, and SSR-specific best practices documented in the skill.
Generated from the current SKILL.md. These answers refresh after source changes.