创建可适应组合式函数 是做什么的?
创建一个库级别的 Vue 组合式函数,该函数接受可能为响应式的输入(MaybeRef / MaybeRefOrGetter),使调用者可以传递普通值、ref 或 getter。在响应式副作用(watch/watchEffect)内部使用 toValue()/toRef() 标准化输入,以保持行为可预测且响应式。当用户要求创建可适应或可复用的组合式函数时使用此技能。
创建一个库级别的 Vue 组合式函数,该函数接受可能为响应式的输入(MaybeRef / MaybeRefOrGetter),使调用者可以传递普通值、ref 或 getter。在响应式副作用(watch/watchEffect)内部使用 toValue()/toRef() 标准化输入,以保持行为可预测且响应式。当用户要求创建可适应或可复用的组合式函数时使用此技能。
该技能专注于创建库级别的 Vue 组合式函数,这些函数能够处理可能为响应式的输入参数(MaybeRef 或 MaybeRefOrGetter),从而使调用者可以灵活地传递普通值、ref 或 getter 函数。通过使用 Vue 3 的 toValue() 和 toRef() 函数,在 watch/watchEffect 等响应式副作用内部对输入进行标准化,确保行为一致且完全响应式。此实践在开发可复用且健壮的 Vue 组合式函数库时至关重要,因为它消除了调用者需要手动处理响应式变化的负担,提升了 API 的灵活性和易用性。该技能适用于任何 Vue 3 项目,特别是那些需要构建高质量、类型安全的组合式函数库的场景。
npx skills add https://github.com/hyf0/vue-skills/tree/main/skills/create-adaptable-composableInstalled? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
创建一个库级别的 Vue 组合式函数,该函数接受可能为响应式的输入(MaybeRef / MaybeRefOrGetter),使调用者可以传递普通值、ref 或 getter。在响应式副作用(watch/watchEffect)内部使用 toValue()/toRef() 标准化输入,以保持行为可预测且响应式。当用户要求创建可适应或可复用的组合式函数时使用此技能。
This repo contains 7 individual skills — each has its own dedicated page.
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.
Pinia stores, state management patterns, store setup, and reactivity with stores.
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.