vue-pinia-best-practices 是做什么的?
Pinia 存储、状态管理模式、存储设置以及与存储的响应式交互。
Pinia 存储、状态管理模式、存储设置以及与存储的响应式交互。
该技能专注于 Vue 应用中 Pinia 状态管理的最佳实践。它涵盖了从存储定义、设置模式到如何有效利用响应式系统与存储交互的全方位内容。技能文档中详细介绍了使用 `defineStore` 创建存储的两种方式(选项式 API 和组合式 API),并强调了在存储中正确使用 `ref`、`computed` 和 `watch` 等响应式 API 的方法。此外,它还讨论了组件之间共享状态、处理异步操作、以及通过 actions 和 getters 组织业务逻辑的典型模式。该技能旨在帮助开发者构建可维护、可扩展且高性能的 Vue 应用状态层。它适用于使用 Vue 3 及相关工具链(如 Vite、TypeScript)的项目,并且与 Pinia 官方推荐的最佳实践保持一致。通过遵循这些模式,开发者可以避免常见的状态管理陷阱,如不必要的响应式开销或状态不一致问题。
npx skills add https://github.com/hyf0/vue-skills/tree/main/skills/vue-pinia-best-practicesInstalled? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
Pinia 存储、状态管理模式、存储设置以及与存储的响应式交互。
This repo contains 7 individual skills — each has its own dedicated page.
Create a library-grade Vue composable that accepts maybe-reactive inputs (MaybeRef / MaybeRefOrGetter) so callers can pass a plain value, ref, or getter. Normalize inputs with toValue()/toRef() inside reactive effects (watch/watchEffect) to keep behavior predictable and reactive. Use this skill when user asks for creating adaptable or reusable composables.
MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.
Vue 3 debugging and error handling for runtime errors, warnings, async failures, and SSR/hydration issues. Use when diagnosing or fixing Vue issues.
JSX syntax in Vue (e.g., class vs className, JSX plugin config).
Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Create, search, and manage Bear notes via grizzly CLI.
Capture frames or clips from RTSP/ONVIF cameras.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.