跳转到主要内容
此内容尚未提供您的语言版本,正在以英文显示。

Create Adaptable Composable

插件 已验证 活跃
属于:Vue Skills

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.

目的

To enable developers to create more robust and reusable Vue 3 composables by standardizing flexible input handling patterns.

功能

  • Generate adaptable Vue composables
  • Normalize MaybeRef/MaybeRefOrGetter inputs
  • Utilize toValue()/toRef() for reactive effects
  • Improve composable reusability and predictability

使用场景

  • When creating reusable Vue 3 composables that need to accept reactive or non-reactive inputs.
  • When aiming for predictable behavior by normalizing inputs within reactive effects.
  • When developing libraries or components that require flexible input patterns.

非目标

  • Creating full Vue components or applications.
  • Providing a general-purpose Vue code generator.
  • Handling runtime configuration or application state management directly.

安装

请先添加 Marketplace

/plugin marketplace add hyf0/vue-skills
/plugin install create-adaptable-composable@vue-skills

质量评分

已验证
98 /100
1 day ago 分析

信任信号

最近提交about 2 months ago
GitHub 所有者 hyf0 (opens in new tab)
星标2.4k
许可证MIT
状态
查看源代码