pinia by antfu/skills
npx skills add https://github.com/antfu/skills --skill piniaPinia 是 Vue 的官方状态管理库,旨在直观且类型安全。它同时支持 Options API 和 Composition API 风格,提供一流的 TypeScript 支持和开发者工具集成。
此技能基于 Pinia v3.0.4,生成于 2026-01-28。
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 存储 | 定义存储、状态、getter、action、storeToRefs、订阅 | core-stores |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 插件 | 使用自定义属性、状态和行为扩展存储 | features-plugins |
| 主题 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 描述 |
|---|
| 参考链接 |
|---|
| 组合式函数 | 在存储中使用 Vue 组合式函数(如 VueUse 等) | features-composables |
| 组合存储 | 存储间通信,避免循环依赖 | features-composing-stores |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 测试 | 使用 @pinia/testing 进行单元测试、模拟、存根 | best-practices-testing |
| 组件外部使用 | 在导航守卫、插件、中间件中使用存储 | best-practices-outside-component |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| SSR | 服务端渲染、状态水合 | advanced-ssr |
| Nuxt | Nuxt 集成、自动导入、SSR 最佳实践 | advanced-nuxt |
| HMR | 开发环境的热模块替换 | advanced-hmr |
storeToRefs() 以保持响应性@pinia/testing 进行带有模拟存储的组件测试每周安装量
7.1K
代码仓库
GitHub 星标数
4.3K
首次出现
2026年1月28日
安全审计
安装于
opencode5.5K
codex5.4K
gemini-cli5.3K
github-copilot5.2K
cursor4.9K
kimi-cli4.7K
Pinia is the official state management library for Vue, designed to be intuitive and type-safe. It supports both Options API and Composition API styles, with first-class TypeScript support and devtools integration.
The skill is based on Pinia v3.0.4, generated at 2026-01-28.
| Topic | Description | Reference |
|---|---|---|
| Stores | Defining stores, state, getters, actions, storeToRefs, subscriptions | core-stores |
| Topic | Description | Reference |
|---|---|---|
| Plugins | Extend stores with custom properties, state, and behavior | features-plugins |
| Topic | Description | Reference |
|---|---|---|
| Composables | Using Vue composables within stores (VueUse, etc.) | features-composables |
| Composing Stores | Store-to-store communication, avoiding circular dependencies | features-composing-stores |
| Topic | Description | Reference |
|---|---|---|
| Testing | Unit testing with @pinia/testing, mocking, stubbing | best-practices-testing |
| Outside Components | Using stores in navigation guards, plugins, middlewares | best-practices-outside-component |
| Topic | Description | Reference |
|---|---|---|
| SSR | Server-side rendering, state hydration | advanced-ssr |
| Nuxt | Nuxt integration, auto-imports, SSR best practices | advanced-nuxt |
| HMR | Hot module replacement for development | advanced-hmr |
storeToRefs() when destructuring state/getters to preserve reactivity@pinia/testing for component tests with mocked storesWeekly Installs
7.1K
Repository
GitHub Stars
4.3K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode5.5K
codex5.4K
gemini-cli5.3K
github-copilot5.2K
cursor4.9K
kimi-cli4.7K
99,500 周安装