Community编程与开发github.com

vuejs-ai/create-adaptable-composable

创建一个库级别的 Vue 组合式函数,接受可能为响应式的输入(MaybeRef / MaybeRefOrGetter),让调用者可以传入普通值、ref 或 getter。在响应式效果(watch/watchEffect)中使用 toValue()/toRef() 标准化输入,以保持行为可预测且响应式。当用户要求创建可适配或可复用的组合式函数时使用此技能。

create-adaptable-composable 是什么?

此技能帮助开发者创建 Vue 组合式函数,这些函数专门设计用于接受可能为响应式的输入(MaybeRef 或 MaybeRefOrGetter),使调用者可以灵活地传入普通值、ref 或 getter。通过在 watch 或 watchEffect 等响应式效果中使用 toValue() 和 toRef() 标准化输入,组合式函数的行为保持可预测且完全响应式。这使得该技能非常适合开发旨在可复用且可适配不同用例的库级组合式函数。它确保以最少的样板代码处理边缘情况,并遵循 Vue 社区的最佳实践。

兼容平台~Claude Code~Codex CLI~Cursor
Part ofReact
npx skills add https://github.com/vuejs-ai/skills/tree/main/skills/create-adaptable-composable

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

create-adaptable-composable 是做什么的?

创建一个库级别的 Vue 组合式函数,接受可能为响应式的输入(MaybeRef / MaybeRefOrGetter),让调用者可以传入普通值、ref 或 getter。在响应式效果(watch/watchEffect)中使用 toValue()/toRef() 标准化输入,以保持行为可预测且响应式。当用户要求创建可适配或可复用的组合式函数时使用此技能。

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

相关技能