重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
vueuse-shared-skilld by harlan-zw/vue-ecosystem-skills
npx skills add https://github.com/harlan-zw/vue-ecosystem-skills --skill vueuse-shared-skilld@vueuse/shared版本: 14.2.1 标签: next: 5.0.0, alpha: 14.0.0-alpha.3, beta: 14.0.0-beta.1, latest: 14.2.1
参考: GitHub Issues — 错误、变通方案、边界情况 • GitHub Discussions — 问答、模式、示例 • Releases — 更新日志、破坏性变更、新 API
本节记录特定版本的 API 变更 — 请优先关注最近的主要/次要版本。
破坏性变更: 需要 Vue 3.5 — v14 现在需要 Vue 3.5+ 以获得原生性能优化 来源
破坏性变更: useThrottleFn 对齐 — v14 与传统的节流行为对齐(默认 leading: true, trailing: false)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
破坏性变更: 仅支持 ESM — v13 移除了对 CJS 构建的支持,包现在仅支持 ESM 来源
破坏性变更: createSharedComposable 返回值 — v14 现在在客户端仅返回 sharedComposable 实例 来源
新增: refManualReset — v14 中的新函数,用于创建带有显式 reset() 方法的 ref 来源
新增: watchAtMost 控制 — v14 在返回值中添加了 pause、resume 和 count 来源
新增: tryOnScopeDispose — v14 添加了可选的 failSilently 参数,用于在作用域外抑制错误 来源
新增: useArrayReduce 类型 — v14.1.0 现在导出了 UseArrayReduceReturn 类型 来源
新增: computedWithControl 源 — v14.1.0 允许在监视源数组中使用不同类型 来源
已弃用: computedEager — v14 已弃用,推荐使用 Vue 3.5 的原生 computed 优化 来源
已弃用: watchPausable — v14 已弃用,推荐使用 Vue 内置的 watch 或 pausableFilter 来源
已弃用: 别名导出 — v14 弃用了次要名称(如 ignorableWatch),推荐使用主要名称 watchIgnorable 来源
已弃用: eagerComputed — v14 弃用了此别名,推荐使用 computedEager 来源
已弃用: controlledComputed — v14 弃用了此别名,推荐使用 computedWithControl 来源
其他变更: createReactiveFn 已弃用 · autoResetRef 已弃用 · debouncedRef 已弃用 · useDebounce 已弃用 · throttledRef 已弃用 · useThrottle 已弃用 · controlledRef 已弃用 · debouncedWatch 已弃用 · ignorableWatch 已弃用 · pausableWatch 已弃用 · throttledWatch 已弃用
优先使用 Vue 3.4+ 内置的 computed() 而非 computedEager() — 标准的计算属性现在仅在返回值实际发生变化时才会触发依赖项,使得急切求值变得不必要 来源
使用 createSharedComposable() 进行 SSR 安全的状态共享 — 它在 SSR 期间会自动回退到非共享实例,以防止跨请求状态污染,同时在客户端保持单例 来源
在同一组件内使用 provideLocal() 和 injectLocal() 共享状态 — 允许访问提供的值而无需经过父/子边界,现已完全支持 Vapor 模式 来源
用 until() 替换手动监视器来处理一次性异步条件 — 提供了一个基于 Promise 的流程控制 API,当 ref 满足特定要求时解析,减少了回调嵌套 来源
// 适用于一次性触发器的首选方式 await until(isReady).toBe(true) doSomething()
实现 refManualReset() 以便轻松恢复状态 — 提供了一个内置的 .reset() 方法,用于将 ref 恢复为其初始值,非常适合清除表单或重置为默认过滤器 来源
使用 reactify() 将普通工具函数转换为响应式函数 — 自动接受 ref 作为参数并返回一个 ComputedRef,从而能够快速开发响应式逻辑 来源
使用 refWithControl() 的 peek() 和 lay() 优化热路径 — 允许读取或写入 ref 的值而不触发响应式系统或跟踪依赖项,从而最大限度地减少不必要的更新 来源
通过 makeDestructurable() 返回双重对象/数组 API — 通过允许用户在位置(数组)或命名(对象)解构之间进行选择,使您的自定义组合式函数更加灵活 来源
在同步期间使用 syncRef() 自定义转换来转换状态 — 使用带有 ltr 和 rtl 函数的 transform 选项在不同类型的 ref 之间映射值 来源
// 将数字 ref 与字符串 ref 同步 syncRef(count, stringCount, { transform: { ltr: left => String(left), rtl: right => Number(right) } })
选择 createGlobalState() 用于持久的应用程序级单例 — 与共享组合式函数在订阅者数量为零时释放状态不同,全局状态在整个应用程序生命周期中保持活动状态 来源
每周安装量
65
代码仓库
GitHub 星标数
151
首次出现
2026年2月19日
安全审计
已安装于
claude-code49
github-copilot49
opencode46
codex45
gemini-cli45
amp44
@vueuse/sharedVersion: 14.2.1 Tags: next: 5.0.0, alpha: 14.0.0-alpha.3, beta: 14.0.0-beta.1, latest: 14.2.1
References: GitHub Issues — bugs, workarounds, edge cases • GitHub Discussions — Q&A, patterns, recipes • Releases — changelog, breaking changes, new APIs
This section documents version-specific API changes — prioritize recent major/minor releases.
BREAKING: Requires Vue 3.5 — v14 now requires Vue 3.5+ for native performance optimizations source
BREAKING: useThrottleFn alignment — v14 aligned with traditional throttle behavior (leading: true, trailing: false by default) source
BREAKING: ESM-only — v13 dropped CJS build support, package is now ESM-only source
BREAKING: createSharedComposable return — v14 now returns only the sharedComposable instance on the client side source
NEW: refManualReset — new function in v14 for creating refs with an explicit reset() method source
NEW: watchAtMost controls — v14 added pause, resume, and count to the return value source
NEW: tryOnScopeDispose — v14 added optional failSilently parameter to suppress errors outside of scope source
NEW: useArrayReduce type — v14.1.0 now exports the UseArrayReduceReturn type source
NEW: computedWithControl sources — v14.1.0 allows different types in watch sources array source
DEPRECATED: computedEager — v14 deprecated in favor of Vue 3.5's native computed optimizations source
DEPRECATED: watchPausable — v14 deprecated in favor of Vue's built-in watch or pausableFilter source
DEPRECATED: Alias exports — v14 deprecated secondary names like ignorableWatch in favor of primary watchIgnorable source
DEPRECATED: eagerComputed — v14 deprecated alias in favor of computedEager source
DEPRECATED: controlledComputed — v14 deprecated alias in favor of computedWithControl source
Also changed: createReactiveFn DEPRECATED · autoResetRef DEPRECATED · debouncedRef DEPRECATED · useDebounce DEPRECATED · throttledRef DEPRECATED · useThrottle DEPRECATED · controlledRef DEPRECATED · debouncedWatch DEPRECATED · ignorableWatch DEPRECATED · pausableWatch DEPRECATED · throttledWatch DEPRECATED
Prefer Vue 3.4+ built-in computed() over computedEager() — standard computed properties now only trigger dependencies if the return value actually changes, making eager evaluation unnecessary source
Use createSharedComposable() for SSR-safe state sharing — it automatically falls back to non-shared instances during SSR to prevent cross-request state pollution, while maintaining a singleton on the client source
Share state within the same component using provideLocal() and injectLocal() — allows accessing provided values without going through the parent/child boundary, now with full Vapor mode support source
Replace manual watchers with until() for one-time async conditions — provides a promise-based API for flow control that resolves once a ref meets a specific requirement, reducing callback nesting
Weekly Installs
65
Repository
GitHub Stars
151
First Seen
Feb 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code49
github-copilot49
opencode46
codex45
gemini-cli45
amp44
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
125,600 周安装
Sentry Python 安装配置指南:错误监控、性能追踪与日志记录
102 周安装
Nansen 预测市场筛选器 - 区块链数据分析工具,实时追踪 Polymarket 交易量与流动性
102 周安装
Git 一键推送所有更改工具 | 自动代码检查、文档更新、提交推送全流程
102 周安装
DOCX文件处理全指南:Python与JavaScript创建、编辑、分析Word文档的SEO优化技巧
102 周安装
Angular Transloco 最佳实践:国际化、懒加载翻译与测试指南
103 周安装
统一项目脚手架工具:AI优先开发、NestJS后端、NextJS前端、Expo移动端、Plasmo扩展
103 周安装
// Preferred for one-time triggers await until(isReady).toBe(true) doSomething()
Implement refManualReset() for easy state restoration — provides a built-in .reset() method to return the ref to its initial value, ideal for clearing forms or reset-to-default filters source
Use reactify() to transform plain utility functions into reactive ones — automatically accepts refs as arguments and returns a ComputedRef, enabling rapid development of reactive logic source
Optimize hot paths with refWithControl() using peek() and lay() — allows reading or writing a ref's value without triggering the reactivity system or tracking dependencies, minimizing unnecessary updates source
Return dual object/array APIs via makeDestructurable() — makes your custom composables more flexible by allowing users to choose between positional (array) or named (object) destructuring source
Convert state during synchronization with syncRef() custom transforms — use the transform option with ltr and rtl functions to map values between refs of different types source
// Sync a number ref with a string ref syncRef(count, stringCount, { transform: { ltr: left => String(left), rtl: right => Number(right) } })
Choose createGlobalState() for persistent application-wide singletons — unlike shared composables which dispose state when subscribers reach zero, global state remains alive for the entire app lifecycle source