NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3399 most downloaded on npm
Collection of essential Vue Composition Utilities
Last release 18 days ago
16 Sep 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
398 releases · first in 2019
Transpile target to es2018, close #3349 - by @antfu in https://github.com/vueuse/vueuse/issues/3349 (0e4a5)
es2018, close #3349 - by @antfu in https://github.com/vueuse/vueuse/issues/3349 <samp>(0e4a5)</samp>refAutoReset: Support maybe-ref as value - by @moander in https://github.com/vueuse/vueuse/issues/3342 (71685)
updateDataOnError option - by @climba03003 and @antfu in https://github.com/vueuse/vueuse/issues/3092 <samp>(945ca)</samp>requestPermissions option, return permissionGranted and ensurePermissions - by @michealroberts and @antfu in https://github.com/vueuse/vueuse/issues/3325 <samp>(a1753)</samp>as prop for component usage - by @menghany in https://github.com/vueuse/vueuse/issues/3274 <samp>(791f7)</samp>type is page, closes #2922 - by @CatsJuice and @antfu in https://github.com/vueuse/vueuse/issues/3244 and https://github.com/vueuse/vueuse/issues/2922 <samp>(c2f64)</samp>isClient to check document too - by @brc-dd and @antfu in https://github.com/vueuse/vueuse/issues/3329 <samp>(786cb)</samp>One column per quarter.
createReusableTemplate: Inherit attrs - by @wiidede and @antfu in https://github.com/vueuse/vueuse/issues/3226 (a32ae)
:focus-visible - by @onmax and @antfu in https://github.com/vueuse/vueuse/issues/3254 <samp>(80329)</samp>useEventListener overload - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/3246 <samp>(4f414)</samp>pointerup event for pressure field - by @cunzaizhuyi and @antfu in https://github.com/vueuse/vueuse/issues/3217 <samp>(ee425)</samp>useDropZone: Expose more hooks - by @antfu (17d8d)
setPrototypeOf - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/3166 <samp>(9f998)</samp>useAsyncQueue: Add options.signal parameter - by @cross-origin in https://github.com/vueuse/vueuse/issues/3033 (7da7c)
options.signal parameter - by @cross-origin in https://github.com/vueuse/vueuse/issues/3033 <samp>(7da7c)</samp>multiple and interval options - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/3089 <samp>(31b66)</samp>reset - by @zaqvil in https://github.com/vueuse/vueuse/issues/3059 <samp>(6d847)</samp>input asynchronously - by @jsonleex in https://github.com/vueuse/vueuse/issues/3118 <samp>(1b0ec)</samp>Nothing published for this version
useColorMode: Expose state to the ref, deprecated emitAuto - by @Waleed-KH and @antfu in https://github.com/vueuse/vueuse/issues/2980 (a1bef)
state to the ref, deprecated emitAuto - by @Waleed-KH and @antfu in https://github.com/vueuse/vueuse/issues/2980 <samp>(a1bef)</samp>watchImmediate and watchDeep support overloads - by @Mini-ghost in https://github.com/vueuse/vueuse/issues/2998 <samp>(8f6a0)</samp>isFullscreen handling for mutliple fullscreen elements - by @zaqvil and @antfu in https://github.com/vueuse/vueuse/issues/3000 <samp>(4a7a1)</samp>Module reference, close #2972 - by @antfu in https://github.com/vueuse/vueuse/issues/2972 (7d001)
nuxt: Do not auto-import toRef and toValue - by @antfu (9225f)
toRef and toValue - by @antfu <samp>(9225f)</samp>Remove deprecated types - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2656 (c2fee)
createReusableTemplate from https://github.com/antfu/vue-reuse-templatecreateTemplatePromise from https://github.com/antfu/vue-template-promiseuseAnimate for native animation API, thanks to @tolkingresolveRef to toRef, resolveUnref to toValue, aligning with Vue 3.3: https://github.com/vuejs/core/pull/7997isFunction and isString utils <samp>(cb644)</samp>resolveRef to toRef <samp>(10e98)</samp>MaybeComputedRef to MaybeRefOrGetter <samp>(4d757)</samp>error should return type unknown - by @jbaubree and @antfu in https://github.com/vueuse/vueuse/issues/2807 <samp>(d8d73)</samp>execute - by @FRSgit and @antfu in https://github.com/vueuse/vueuse/issues/2485 <samp>(edece)</samp>disableTransition by default <samp>(5c82c)</samp>isFinished - by @jssullivan and james.sullivan in https://github.com/vueuse/vueuse/issues/2474 <samp>(ef281)</samp>orientationchange listener - by @zhousg and @antfu in https://github.com/vueuse/vueuse/issues/2919 <samp>(4e7b0)</samp>trigger - by @Akryum and @antfu in https://github.com/vueuse/vueuse/issues/2824 <samp>(31347)</samp>resolveUnref to toValue <samp>(0a72b)</samp>manual option - by @jaw52 and @antfu in https://github.com/vueuse/vueuse/issues/2903 <samp>(16461)</samp>onFinish callback - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2829 <samp>(a2f33)</samp>initialData and resetOnExecute options - by @Alfred-Skyblue and @antfu in https://github.com/vueuse/vueuse/issues/2791 <samp>(f54a3)</samp>selector - by @Wing-9527 and @antfu in https://github.com/vueuse/vueuse/issues/2760 <samp>(02ccc)</samp>system and store ref, close #2023 - by @antfu in https://github.com/vueuse/vueuse/issues/2023 <samp>(d150c)</samp>observe option - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2800 <samp>(ae6e1)</samp>useColorSchema - by @godismyjudge95 and @antfu in https://github.com/vueuse/vueuse/issues/2866 <samp>(d6d35)</samp>disableTransition option <samp>(320ab)</samp>axis option - by @Alfred-Skyblue and @antfu in https://github.com/vueuse/vueuse/issues/2948 <samp>(0842a)</samp>capture option - by @faga295 and @antfu in https://github.com/vueuse/vueuse/issues/2725 <samp>(3996d)</samp>reset capability - by @nahvego and @antfu in https://github.com/vueuse/vueuse/issues/2880 <samp>(f4d35)</samp>Pausable interface - by @Mini-ghost and @antfu in https://github.com/vueuse/vueuse/issues/2883 <samp>(4b336)</samp>type: screen - by @francoislevesque in https://github.com/vueuse/vueuse/issues/2467 <samp>(39d18)</samp>transform handler - by @edumudu and @antfu in https://github.com/vueuse/vueuse/issues/2191 <samp>(d23ca)</samp>styleTarget option to style other element - by @jd-solanki in https://github.com/vueuse/vueuse/issues/2312 <samp>(a3e95)</samp>MaybeComputedRef - by @zhiyuanzmj in https://github.com/vueuse/vueuse/issues/2871 <samp>(5944e)</samp>shouldEmit hook - by @baiwusanyu-c and @antfu in https://github.com/vueuse/vueuse/issues/2836 <samp>(f8a53)</samp>window is not defined - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/2793 <samp>(c86f2)</samp>Remove isFunction and isString utils - by @antfu (cb644)
isFunction and isString utils - by @antfu <samp>(cb644)</samp>toRef: Rename resolveRef to toRef - by @antfu (10e98)
resolveRef to toRef - by @antfu <samp>(10e98)</samp>MaybeComputedRef to MaybeRefOrGetter - by @antfu <samp>(4d757)</samp>execute - by @FRSgit and @antfu in https://github.com/vueuse/vueuse/issues/2485 <samp>(edece)</samp>disableTransition by default - by @antfu <samp>(5c82c)</samp>resolveUnref to toValue - by @antfu <samp>(0a72b)</samp>initialData and resetOnExecute options - by @Alfred-Skyblue and @antfu in https://github.com/vueuse/vueuse/issues/2791 <samp>(f54a3)</samp>selector - by @Wing-9527 and @antfu in https://github.com/vueuse/vueuse/issues/2760 <samp>(02ccc)</samp>system and store ref, close #2023 - by @antfu in https://github.com/vueuse/vueuse/issues/2023 <samp>(d150c)</samp>capture option - by @faga295 and @antfu in https://github.com/vueuse/vueuse/issues/2725 <samp>(3996d)</samp>Pausable interface - by @Mini-ghost and @antfu in https://github.com/vueuse/vueuse/issues/2883 <samp>(4b336)</samp>type: screen - by @francoislevesque in https://github.com/vueuse/vueuse/issues/2467 <samp>(39d18)</samp>transform handler - by @edumudu and @antfu in https://github.com/vueuse/vueuse/issues/2191 <samp>(d23ca)</samp>useAxios: Remove deprecated apis - by @antfu (1f8b9)
orientationchange listener - by @zhousg and @antfu in https://github.com/vueuse/vueuse/issues/2919 <samp>(4e7b0)</samp>axis option - by @Alfred-Skyblue and @antfu in https://github.com/vueuse/vueuse/issues/2948 <samp>(0842a)</samp>useElementVisibility: Use useIntersectionObserver instead of scroll event handler - by @curtgrimes in https://github.com/vueuse/vueuse/issues/2551 (74
manual option - by @jaw52 and @antfu in https://github.com/vueuse/vueuse/issues/2903 <samp>(16461)</samp>onFinish callback - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2829 <samp>(a2f33)</samp>useColorSchema - by @godismyjudge95 and @antfu in https://github.com/vueuse/vueuse/issues/2866 <samp>(d6d35)</samp>useAsyncValidator: Add immediate and execute - by @jaw52 and @antfu in https://github.com/vueuse/vueuse/issues/2899 (79176)
reset capability - by @nahvego and @antfu in https://github.com/vueuse/vueuse/issues/2880 <samp>(f4d35)</samp>MaybeComputedRef - by @zhiyuanzmj in https://github.com/vueuse/vueuse/issues/2871 <samp>(5944e)</samp>shouldEmit hook - by @baiwusanyu-c and @antfu in https://github.com/vueuse/vueuse/issues/2836 <samp>(f8a53)</samp>Remove deprecated types - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2656 (c2fee)
error should return type unknown - by @jbaubree and @antfu in https://github.com/vueuse/vueuse/issues/2807 <samp>(d8d73)</samp>isFinished - by @jssullivan and james.sullivan in https://github.com/vueuse/vueuse/issues/2474 <samp>(ef281)</samp>trigger - by @Akryum and @antfu in https://github.com/vueuse/vueuse/issues/2824 <samp>(31347)</samp>observe option - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2800 <samp>(ae6e1)</samp>disableTransition option - by @antfu <samp>(320ab)</samp>styleTarget option to style other element - by @jd-solanki in https://github.com/vueuse/vueuse/issues/2312 <samp>(a3e95)</samp>window is not defined - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/2793 <samp>(c86f2)</samp>useArrayFindLast: New function - by @huynl-96 in https://github.com/vueuse/vueuse/issues/2471 (b0ac4)
reset function - by @mohammadhosry and Mohammad Agbareya in https://github.com/vueuse/vueuse/issues/2686 <samp>(81db6)</samp>stop function - by @zwkkwz1 in https://github.com/vueuse/vueuse/issues/2774 <samp>(820e2)</samp>isFetchOptions - by @antfu <samp>(c2bc6)</samp>focus and blur to the targetElement - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/2631 <samp>(7cd88)</samp>scrollX instead of pageXOffset - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/2776 <samp>(e490a)</samp>usePrevious: New function - by @antfu (e101f)
nuxt: Add metadata to auto import - by @antfu (eee12)
computedAsync: Introduce shadow option - by @xiankaiqun in https://github.com/vueuse/vueuse/issues/2616 (a0656)
shadow option - by @xiankaiqun in https://github.com/vueuse/vueuse/issues/2616 <samp>(a0656)</samp>defineComponent as pure - by @vaakian and @wheatjs in https://github.com/vueuse/vueuse/issues/2623 <samp>(d5321)</samp>useActiveElement: Support shadow roots - by @43081j and @antfu in https://github.com/vueuse/vueuse/issues/2592 (07f20)
scrollTo in component - by @Agapanthus and Eric Skaliks in https://github.com/vueuse/vueuse/issues/2397 <samp>(9f495)</samp>target ref nullable - by @vaakian in https://github.com/vueuse/vueuse/issues/2579 <samp>(28614)</samp>useAsyncState: Add onSuccess callbacks - by @Alfred-Skyblue in https://github.com/vueuse/vueuse/issues/2562 (ed64f)
foramtTimeAgo -> formatTimeAgo - by @QGIsK in https://github.com/vueuse/vueuse/issues/2568 <samp>(bb0fd)</samp>useStorage: Sync within page, close #1595 - by @antfu in https://github.com/vueuse/vueuse/issues/1595 (800f7)
useStorage: Resume the watch after setting the value, fix loop updates - by @antfu (c3851)
extendRef: Support 2.7, close #2340 - by @antfu in https://github.com/vueuse/vueuse/issues/2340 (8c82e)
formatTimeAgo - by @antfu <samp>(9293c)</samp>createEeventHook: Auto dispose - by @ARZarkesh and @antfu in https://github.com/vueuse/vueuse/issues/2518 (fdd4d)
delta and timestamp - by @innocenzi in https://github.com/vueuse/vueuse/issues/2493 <samp>(692d0)</samp>floor and ceil value calculation - by @userquin and @antfu in https://github.com/vueuse/vueuse/issues/2543 <samp>(a7dc6)</samp>clientX instead of pageX, close #2053 - by @stefnotch in https://github.com/vueuse/vueuse/issues/2054 and https://github.com/vueuse/vueuse/issues/2053 <samp>(c9186)</samp>showSecond prop to component - by @CS-Birb in https://github.com/vueuse/vueuse/issues/2547 <samp>(0c333)</samp>onClickOutside: Call handler if click event is fired by a keypress - by @sibbng in https://github.com/vueuse/vueuse/issues/2426 (ff96d)
click event is fired by a keypress - by @sibbng in https://github.com/vueuse/vueuse/issues/2426 <samp>(ff96d)</samp>onClickOutside: Support options in component - by @fiadone and @sibbng in https://github.com/vueuse/vueuse/issues/2391
events or listeners - by @vaakian and @antfu in https://github.com/vueuse/vueuse/issues/2180document - by @sibbng in https://github.com/vueuse/vueuse/issues/2404refDebounced: Use MaybeComputedRef for ms - by @dominikklein in https://github.com/vueuse/vueuse/issues/2337
close issued between retries - by @rotu in https://github.com/vueuse/vueuse/issues/2330fromEvent: Support HTMLElement - by @rorry121 and @antfu in https://github.com/vueuse/vueuse/issues/2048
shallowRef for bluetooth instance - by @antfu <samp>(0199b)</samp>chainCallbacks behavior - by @GODLiangCY in https://github.com/vueuse/vueuse/issues/2231observe and titleTemplate been specified at the same time - by @huynl-96 and @antfu in https://github.com/vueuse/vueuse/issues/2049Optional callback for useInterval, useTimeout & useTimestamp - by @Waleed-KH in https://github.com/vueuse/vueuse/issues/2240
bubble modifier to directive - by @sibbng in https://github.com/vueuse/vueuse/issues/2183ref - by @GODLiangCY in https://github.com/vueuse/vueuse/issues/2178showSecond option - by @azaleta in https://github.com/vueuse/vueuse/issues/2209pointerdown event - by @GODLiangCY in https://github.com/vueuse/vueuse/issues/2198.not returns new instance - by @lsdsjy and @antfu in https://github.com/vueuse/vueuse/issues/2224Bump Nuxt support to RC.9, update autoImports:sources hook - by @DamianGlowala in https://github.com/vueuse/vueuse/issues/2166
autoImports:sources hook - by @DamianGlowala in https://github.com/vueuse/vueuse/issues/2166execute - by @azaleta in https://github.com/vueuse/vueuse/issues/2152greaterOrEqual etc. - by @azaleta in https://github.com/vueuse/vueuse/issues/2148trigger element - by @imguolao in https://github.com/vueuse/vueuse/issues/2133box sizing - by @vaakian and @antfu in https://github.com/vueuse/vueuse/issues/2143write option - by @waldonUB in https://github.com/vueuse/vueuse/issues/2165clone option - by @edumudu and @antfu in https://github.com/vueuse/vueuse/issues/2022includeScrollbar - by @vaakian in https://github.com/vueuse/vueuse/issues/2161execute - by @flyingTodream in https://github.com/vueuse/vueuse/issues/2095getKey - by @chaii3 in https://github.com/vueuse/vueuse/issues/2074usePreferredContrast: New function - by @Zhaocl1997 in https://github.com/vueuse/vueuse/issues/2040
computedWithControl instead of counter ref - by @vaakian in https://github.com/vueuse/vueuse/issues/2093location - by @mskr in https://github.com/vueuse/vueuse/issues/2066useToFixed: Deprecated in favor of usePrecision - by @antfu (790ef)
MaybeComputedRef - by @antfu <samp>(28c5a)</samp>src arg - by @huynl-96 in https://github.com/vueuse/vueuse/issues/2030usePrecision - by @antfu <samp>(790ef)</samp>TransitionPresets - by @antfu <samp>(cc865)</samp>nuxt: Disable auto import for integrations - by @antfu (0a43b)
integrations - by @antfu <samp>(0a43b)</samp>useDateFormat: Support dd, ddd and dddd formatter - by @aki77 in https://github.com/vueuse/vueuse/issues/1986
all: isSupported becomes Ref instead of boolean for SSR compatibility - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1800
isSupported becomes Ref<boolean> instead of boolean for SSR compatibility - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1800Use prefix, huge thanks to @okxiaoliang4! (this should not affect most of the usage case, unless you are importing those types directly)
<details><summary>All Changes</summary>
Status to UseSpeechSynthesisStatus - by @antfu <samp>(db61f)</samp>KeyStrokeOptions to OnKeyStrokeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1807AsyncStateOptions to UseAsyncStateOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1809ClipboardOptions to UseClipboardOptions and ClipboardReturn to UseClipboardReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1861VisibilityScrollTargetOptions to UseElementVisibilityOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1863UseEventSourceReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1864FaviconOptions to UseFaviconOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1865FocusWithinReturn to UseFocusWithinReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1866GeolocationOptions to UseGeolocationOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1868IdleOptions to UseIdleOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1869IntersectionObserverOptions to UseIntersectionObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1870JwtOptions to UseJwtOptions and JwtResult to UseJwtReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1899ModifierOptions to UseModifierOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1871MagicKeys to UseMagicKeysReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1873UseMemoizedFn to UseMemoizeReturn and new type UseMemoizeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1872MemoryOptions to UseMemoryOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1605MouseOptions to UseMouseOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1877MutationObserverOptions to UseMutationObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1884ParallaxOptions to UseParallaxOptions and ParallaxReturn to UseParallaxReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1885PointerSwipeOptions to UsePointerSwipeOptions and PointerSwipeReturn to UsePointerSwipeReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1886RTDBOptions to UseRTDBOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1901RafFnOptions to UseRafFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1887ResizeObserverOptions to UseResizeObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1862ShareOptions to UseShareOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1888SpeechRecognitionOptions to UseSpeechRecognitionOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1889SpeechSynthesisOptions to UseSpeechSynthesisOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1890voiceInfo, allow voice as ref - by @sibbng in https://github.com/vueuse/vueuse/issues/1882StorageOptions to UseStorageOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1867StorageAsyncOptions to UseStorageAsyncOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1883SwipeOptions to UseSwipeOptions and SwipeReturn to UseSwipeReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1891TimestampOptions to UseTimestampOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1892TransitionOptions to UseTransitionOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1893VModelOptions to UseVModelOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1894WebSocketOptions to UseWebSocketOptions and WebSocketResult to UseWebSocketReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1895WebWorkerOptions to UseWebWorkerOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1896WindowSizeOptions to UseWindowSizeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1897IntervalOptions to UseIntervalOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1945IntervalFnOptions to UseIntervalFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1943TimeoutOptions to UseTimeoutOptions and TimeoutFnOptions to UseTimeoutFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1944
</details>logicAnd, logicOr, logicNot, useClamp to @vueuse/math - by @antfu in https://github.com/vueuse/vueuse/issues/1794, https://github.com/vueuse/vueuse/issues/1810trailing option should be false by default - by @webfansplz and @antfu in https://github.com/vueuse/vueuse/issues/1687key instead of keyCode in current - by @wvffle in https://github.com/vueuse/vueuse/issues/1506all: Support reactive getter as argument - in https://github.com/vueuse/vueuse/issues/1768
This introduces a new convention of passing reactive getters as arguments. Previously, many of VueUse functions supported a convention to accept optional Ref as arguments (MaybeRef<T>) to make the reactivity connections. For example:
// pass plain value
const title = useTitle('foo') // changes title to 'foo'
// pass a ref
const myTitle = ref('foo')
useTitle(myTitle) // changes title to 'foo'
// reactive triggers the update
myTitle.value = 'bar' // changes title to 'bar'
Since v9.0, most of the VueUse function also accepts a getter function similar to computed or the watch source of watch to provide better flexibility.
// before
const title = computed(() => `${foo.value} | template`)
useTitle(title)
// with 9.0
useTitle(() => `${foo.value} | template`)
It also works great with Reactivity Transform.
// before
const title = $('foo')
useTitle($$(title)) // you need to use $$() to preserve the reactive
// with 9.0
const title = $('foo')
useTitle(() => title) // you can use a getter function just like `watch`
math: New @vueuse/math package
New Array-related utilities
syncRef: Support custom transforms - by @chaii3 and @antfu in https://github.com/vueuse/vueuse/issues/1968
useAsyncState: Add throwError option - by @TuiMao233 and @antfu in https://github.com/vueuse/vueuse/issues/1975
useColorMode: New initialValue option - by @antfu <samp>(fcaf9)</samp>
useStorage: mergeDefaults option - by @webfansplz and @antfu in https://github.com/vueuse/vueuse/issues/1957
useTextDirection: New function - by @iChengbo and @antfu in https://github.com/vueuse/vueuse/issues/1678
@vueuse/integrations - by @antfu <samp>(18ba0)</samp>currentPageSize value - by @webfansplz in https://github.com/vueuse/vueuse/issues/1949onend, fix demo - by @sibbng in https://github.com/vueuse/vueuse/issues/1941CLOSED - by @chaii3 in https://github.com/vueuse/vueuse/issues/1960firebase: Support firebase 9 - by @antfu (9c65f)
throwError option - by @TuiMao233 and @antfu in https://github.com/vueuse/vueuse/issues/1975initialValue option - by @antfu <samp>(fcaf9)</samp>mergeDefaults option - by @webfansplz and @antfu in https://github.com/vueuse/vueuse/issues/1957useInterval: Rename type IntervalOptions to UseIntervalOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1945
IntervalOptions to UseIntervalOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1945IntervalFnOptions to UseIntervalFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1943TimeoutOptions to UseTimeoutOptions and TimeoutFnOptions to UseTimeoutFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1944@vueuse/integrations - by @antfu <samp>(18ba0)</samp>currentPageSize value - by @webfansplz in https://github.com/vueuse/vueuse/issues/1949onend, fix demo - by @sibbng in https://github.com/vueuse/vueuse/issues/1941CLOSED - by @chaii3 in https://github.com/vueuse/vueuse/issues/1960all: isSupported becomes Ref instead of boolean for SSR compatibility - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1800
isSupported becomes Ref<boolean> instead of boolean for SSR compatibility - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1800Use prefix, huge thanks to @okxiaoliang4! (this should not affect most of the usage case, unless you are importing those types directly)
<details><summary>All Changes</summary>
Status to UseSpeechSynthesisStatus - by @antfu <samp>(db61f)</samp>KeyStrokeOptions to OnKeyStrokeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1807AsyncStateOptions to UseAsyncStateOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1809ClipboardOptions to UseClipboardOptions and ClipboardReturn to UseClipboardReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1861VisibilityScrollTargetOptions to UseElementVisibilityOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1863UseEventSourceReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1864FaviconOptions to UseFaviconOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1865FocusWithinReturn to UseFocusWithinReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1866GeolocationOptions to UseGeolocationOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1868IdleOptions to UseIdleOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1869IntersectionObserverOptions to UseIntersectionObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1870JwtOptions to UseJwtOptions and JwtResult to UseJwtReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1899ModifierOptions to UseModifierOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1871MagicKeys to UseMagicKeysReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1873UseMemoizedFn to UseMemoizeReturn and new type UseMemoizeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1872MemoryOptions to UseMemoryOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1605MouseOptions to UseMouseOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1877MutationObserverOptions to UseMutationObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1884ParallaxOptions to UseParallaxOptions and ParallaxReturn to UseParallaxReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1885PointerSwipeOptions to UsePointerSwipeOptions and PointerSwipeReturn to UsePointerSwipeReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1886RTDBOptions to UseRTDBOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1901RafFnOptions to UseRafFnOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1887ResizeObserverOptions to UseResizeObserverOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1862ShareOptions to UseShareOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1888SpeechRecognitionOptions to UseSpeechRecognitionOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1889SpeechSynthesisOptions to UseSpeechSynthesisOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1890voiceInfo, allow voice as ref - by @sibbng in https://github.com/vueuse/vueuse/issues/1882StorageOptions to UseStorageOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1867StorageAsyncOptions to UseStorageAsyncOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1883SwipeOptions to UseSwipeOptions and SwipeReturn to UseSwipeReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1891TimestampOptions to UseTimestampOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1892TransitionOptions to UseTransitionOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1893VModelOptions to UseVModelOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1894WebSocketOptions to UseWebSocketOptions and WebSocketResult to UseWebSocketReturn - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1895WebWorkerOptions to UseWebWorkerOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1896WindowSizeOptions to UseWindowSizeOptions - by @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1897
</details>logicAnd, logicOr, logicNot, useClamp to @vueuse/math - by @antfu in https://github.com/vueuse/vueuse/issues/1794, https://github.com/vueuse/vueuse/issues/1810trailing option should be false by default - by @webfansplz and @antfu in https://github.com/vueuse/vueuse/issues/1687key instead of keyCode in current - by @wvffle in https://github.com/vueuse/vueuse/issues/1506all: Support reactive getter as argument - in https://github.com/vueuse/vueuse/issues/1768
This introduces a new convention of passing reactive getters as arguments. Previously, many of VueUse functions supports a convention to accept optional Ref as arguments (MaybeRef<T>) to making the reactivity connections. For example:
// pass plain value
const title = useTitle('foo') // changes title to 'foo'
// pass a ref
const myTitle = ref('foo')
useTitle(myTitle) // changes title to 'foo'
// reactive triggers the update
myTitle.value = 'bar' // changes title to 'bar'
Since v9.0, most of the VueUse function also accepts a getter function similar to computed or the watch source of watch to provide better flexibility.
// before
const title = computed(() => `${foo.value} | template`)
useTitle(title)
// with 9.0
useTitle(() => `${foo.value} | template`)
It also works great with Reactivity Transform.
// before
const title = $('foo')
useTitle($$(title)) // you need to use $$() to preseve the reactive
// with 9.0
const title = $('foo')
useTitle(() => title) // you can use a getter function just like `watch`
math: New @vueuse/math package
New Array related utilities
useDropZone: Improve argument type - by @aki77 in https://github.com/vueuse/vueuse/issues/1933
UseFileDialogReturn type - by @xiaoxiangmoe in https://github.com/vueuse/vueuse/issues/1927useStyleTag: Fix hydration mismatch issue - by @sibbng in https://github.com/vueuse/vueuse/issues/1918
onClickOutside: Add detectIframe option - by @sibbng in https://github.com/vueuse/vueuse/issues/1795
detectIframe option - by @sibbng in https://github.com/vueuse/vueuse/issues/1795useFileDialog: SSR compatible, close #1788 - by @antfu (58a45)
useFileDialog: New function - by @wobsoriano, @antfu and @okxiaoliang4 in https://github.com/vueuse/vueuse/issues/1218
computedWithControl: Support manual triggering - by @antfu (01fca)
trigger only work in Vue 3 - by @antfu <samp>(a1077)</samp>onLongPress: Added modifiers - by @chaii3 in https://github.com/vueuse/vueuse/issues/1719
auto mode - by @dfreier and @antfu in https://github.com/vueuse/vueuse/issues/1627orientationchange event - by @okxiaoliang4 and @antfu in https://github.com/vueuse/vueuse/issues/1609watch with a manual trigger - by @LittleSound in https://github.com/vueuse/vueuse/issues/1736reactiveOmit and reactivePick support array as second arg - by @Brain777777 in https://github.com/vueuse/vueuse/issues/1742isSupported check - by @antfu <samp>(5a64c)</samp>Add @types/web-bluetooth as dep, close `#1704` by @antfu
@types/web-bluetooth as dep, close #1704 by @antfuThanks to @antfu | @carlosgamezdev | @michealroberts | @okxiaoliang4
#1657Thanks to @antfu | @carlosgamezdev | @michealroberts | @okxiaoliang4
### 🐞 Bug Fixes - ci: - Release script `0d3c1f7a` ### ❤️ Contributors Thanks to @antfu ##### View changes on GitHub
*No significant changes* ### ❤️ Contributors Thanks to @antfu ##### View changes on GitHub
*No significant changes* ### ❤️ Contributors Thanks to @antfu ##### View changes on GitHub
Avoid calling safari workaround on right click `#1673`
#1673$el is null/undefined #1657headersToObject 8f541b0a#1676getModifierState is not function error in Chrome #1654#1663#1661T type for WatchCallback #1692Thanks to @antfu | @arcs- | @DrJume | @HannesOberreiter | @HassanZahirnia | @hsyq | @LeSuisse | @luciorubeens | @lvjiaxuan | @meteorlxy | @nhedger | @sibbng | @YunYouJun | @zojize
shared: correct to ignore undefined
focused should be false when element is undefined (#1580) (f0067ac)isSupported flag (#1575) (0222d48)useScrollLock: lock on element instead of document
useVModel: returning undefined on false values
computedAsync: keep evaluating true for concurrent changes
pointerup event if click event not propagate (#1522) (89c9e53)isLoading not reset (#1518) (a8fd617)args incorrect (#1534) (81f355d)aborted to isAborted (#1519) (e2a9ac3)update on mounted (#626) (#1541) (dccd1f3)onlineAt attribute (#1535) (4d5cf1c)### Bug Fixes * nuxt: transpile ssr plugin (dfcee11) ### Features * og:image for each route
refAutoReset: clear timeout on scope dispose
cancelAnimationFrame on pause (#1502) (a21bd2b)Your coding agent can read these notes before it upgrades. Set up the MCP server →