vue-pinia-best-practices
vuejs-ai/skills
了解 Pinia 在 Vue 應用程式中的最佳實務、常見陷阱以及狀態管理模式。
...展開全部Pinia 的最佳實務、常見陷阱與狀態管理模式。
儲存設定
- 啟動時出現「getActivePinia 已被呼叫」錯誤 → 請參閱 pinia-no-active-pinia-error
- 在 DevTools 或 SSR 中設定儲存庫時缺少狀態 → 請參閱 pinia-setup-store-return-all-state
反應性
- Store 解構導致 UI 無法繼續反應式更新 → 參閱 pinia-store-destructuring-breaks-reactivity
- 在模板呼叫中,Store 方法會失去上下文 → 參閱 store-method-binding-parentheses
狀態模式
- 篩選器在重新載入時會重置或無法共享 → 參見 state-url-for-ephemeral-filters
- 在不使用 DevTools 或遵循慣例的情況下建置生產環境應用程式 → 參見 state-use-pinia-for-large-apps
---
name: vue-pinia-best-practices
description: Learn Pinia best practices, common gotchas, and state management patterns for Vue applications.
license: MIT
---
Pinia best practices, common gotchas, and state management patterns.
### Store Setup
- Getting "getActivePinia was called" error at startup → See [pinia-no-active-pinia-error](reference/pinia-no-active-pinia-error.md)
- Setup stores missing state in DevTools or SSR → See [pinia-setup-store-return-all-state](reference/pinia-setup-store-return-all-state.md)
### Reactivity
- Store destructuring stops updating UI reactively → See [pinia-store-destructuring-breaks-reactivity](reference/pinia-store-destructuring-breaks-reactivity.md)
- Store methods lose context in template calls → See [store-method-binding-parentheses](reference/store-method-binding-parentheses.md)
### State Patterns
- Filters reset on refresh or can't be shared → See [state-url-for-ephemeral-filters](reference/state-url-for-ephemeral-filters.md)
- Building production app without DevTools or conventions → See [state-use-pinia-for-large-apps](reference/state-use-pinia-for-large-apps.md)
所有檔案
7 個檔案安裝 vue-pinia-best-practices
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/vuejs-ai/skills/tree/main/skills/vue-pinia-best-practices # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
