Releases: vueuse/vueuse
v9.1.0
🚀 Features
- useCycleList: Support MaybeRef for initialValue - by @Waleed-KH in #2025
- usePrecision: New function - by @antfu (49c8a)
- usePreferredReducedMotion: New function - by @Zhaocl1997 in #2039
- useToNumber: New function - by @antfu (f69a3)
- useToString: New function - by @antfu (2b869)
🐞 Bug Fixes
- Improve
MaybeComputedRef
- by @antfu (28c5a) - useFavicon: Writable return type - by @chaii3 and @antfu in #2036
- useOffsetPagination: Min value for pageCount should be 1 - by @jd-solanki and @antfu in #2001
- useScriptTag: Normalize
src
arg - by @huynl-96 in #2030 - useToFixed: Deprecated in favor of
usePrecision
- by @antfu (790ef) - useTransition: Improve type of
TransitionPresets
- by @antfu (cc865)
View changes on GitHub
v9.0.2
v9.0.1
🚀 Features
- useDateFormat: Support dd, ddd and dddd formatter - by @aki77 in #1986
- useFirestore: Support reactive query - by @kiyopikko in #2008
- useToFixed: New function - by @FliPPeDround in #2003
🐞 Bug Fixes
- useColorMode: When emitAuto is true, onChanged does not trigger when preferredMode changed - by @Waleed-KH in #2004
- useFetch: Broken callbacks when RequestInit and UseFetchOptions are both passed in - by @curtgrimes in #2013
View changes on GitHub
v9.0.0
🚨 Breaking Changes
- all:
isSupported
becomesRef<boolean>
instead ofboolean
for SSR compatibility - by @okxiaoliang4 in #1800 - all: Rename function options type with consistant
Use
prefix, huge thanks to @okxiaoliang4! (this should not affect most of the usage case, unless you are importing those types directly)-
All Changes
- useSpeechSynthesis: Rename type
Status
toUseSpeechSynthesisStatus
- by @antfu (db61f) - onKeyStroke: Rename type
KeyStrokeOptions
toOnKeyStrokeOptions
- by @okxiaoliang4 in #1807 - useAsyncState: Rename type
AsyncStateOptions
toUseAsyncStateOptions
- by @okxiaoliang4 in #1809 - useClipboard: Rename type
ClipboardOptions
toUseClipboardOptions
andClipboardReturn
toUseClipboardReturn
- by @okxiaoliang4 in #1861 - useElementVisibility: Rename type
VisibilityScrollTargetOptions
toUseElementVisibilityOptions
- by @okxiaoliang4 in #1863 - useEventSource: Return type should be
UseEventSourceReturn
- by @okxiaoliang4 in #1864 - useFavicon: Rename type
FaviconOptions
toUseFaviconOptions
- by @okxiaoliang4 in #1865 - useFocusWithin: Rename type
FocusWithinReturn
toUseFocusWithinReturn
- by @okxiaoliang4 in #1866 - useGeolocation: Rename type
GeolocationOptions
toUseGeolocationOptions
- by @okxiaoliang4 in #1868 - useIdle: Rename type
IdleOptions
toUseIdleOptions
- by @okxiaoliang4 in #1869 - useIntersectionObserver: Rename type
IntersectionObserverOptions
toUseIntersectionObserverOptions
- by @okxiaoliang4 in #1870 - useJwt: Rename type
JwtOptions
toUseJwtOptions
andJwtResult
toUseJwtReturn
- by @okxiaoliang4 in #1899 - useKeyModifier: Rename type
ModifierOptions
toUseModifierOptions
- by @okxiaoliang4 in #1871 - useMagicKeys: Rename type
MagicKeys
toUseMagicKeysReturn
- by @okxiaoliang4 in #1873 - useMemoize: Rename type
UseMemoizedFn
toUseMemoizeReturn
and new typeUseMemoizeOptions
- by @okxiaoliang4 in #1872 - useMemory: Rename type
MemoryOptions
toUseMemoryOptions
- by @okxiaoliang4 in #1605 - useMouse: Rename type
MouseOptions
toUseMouseOptions
- by @okxiaoliang4 in #1877 - useMutationObserver: Rename type
MutationObserverOptions
toUseMutationObserverOptions
- by @okxiaoliang4 in #1884 - useParallax: Rename type
ParallaxOptions
toUseParallaxOptions
andParallaxReturn
toUseParallaxReturn
- by @okxiaoliang4 in #1885 - usePointerSwipe: Rename type
PointerSwipeOptions
toUsePointerSwipeOptions
andPointerSwipeReturn
toUsePointerSwipeReturn
- by @okxiaoliang4 in #1886 - useRTDB: Rename type
RTDBOptions
toUseRTDBOptions
- by @okxiaoliang4 in #1901 - useRafFn: Rename type
RafFnOptions
toUseRafFnOptions
- by @okxiaoliang4 in #1887 - useResizeObserver: Rename type
ResizeObserverOptions
toUseResizeObserverOptions
- by @okxiaoliang4 in #1862 - useShare: Rename type
ShareOptions
toUseShareOptions
- by @okxiaoliang4 in #1888 - useSpeechRecognition: Rename type
SpeechRecognitionOptions
toUseSpeechRecognitionOptions
- by @okxiaoliang4 in #1889 - useSpeechSynthesis: Rename type
SpeechSynthesisOptions
toUseSpeechSynthesisOptions
- by @okxiaoliang4 in #1890 - useSpeechSynthesis: Remove
voiceInfo
, allowvoice
as ref - by @sibbng in #1882 - useStorage: Rename type
StorageOptions
toUseStorageOptions
- by @okxiaoliang4 in #1867 - useStorageAsync: Rename type
StorageAsyncOptions
toUseStorageAsyncOptions
- by @okxiaoliang4 in #1883 - useSwipe: Rename type
SwipeOptions
toUseSwipeOptions
andSwipeReturn
toUseSwipeReturn
- by @okxiaoliang4 in #1891 - useTimestamp: Rename type
TimestampOptions
toUseTimestampOptions
- by @okxiaoliang4 in #1892 - useTransition: Rename type
TransitionOptions
toUseTransitionOptions
- by @okxiaoliang4 in #1893 - useVModel: Rename type
VModelOptions
toUseVModelOptions
- by @okxiaoliang4 in #1894 - useWebSocket: Rename type
WebSocketOptions
toUseWebSocketOptions
andWebSocketResult
toUseWebSocketReturn
- by @okxiaoliang4 in #1895 - useWebWorkerFn: Rename type
WebWorkerOptions
toUseWebWorkerOptions
- by @okxiaoliang4 in #1896 - useWindowSize: Rename type
WindowSizeOptions
toUseWindowSizeOptions
- by @okxiaoliang4 in #1897 - useInterval: Rename type
IntervalOptions
toUseIntervalOptions
- by @okxiaoliang4 in #1945 - useIntervalFn: Rename type
IntervalFnOptions
toUseIntervalFnOptions
- by @okxiaoliang4 in #1943 - useTimeoutFn,useTimeout: Rename type
TimeoutOptions
toUseTimeoutOptions
andTimeoutFnOptions
toUseTimeoutFnOptions
- by @okxiaoliang4 in #1944
- useSpeechSynthesis: Rename type
-
- firebase: Support firebase 9 modular - by @antfu (9c65f)
- math: Move
logicAnd
,logicOr
,logicNot
,useClamp
to@vueuse/math
- by @antfu in #1794, #1810 - reactify: Enable support for reactive getter by default - by @antfu in #1860
- useThrottleFn:
trailing
option should befalse
by default - by @webfansplz and @antfu in #1687 - useMagicKeys: Store
key
instead ofkeyCode
incurrent
- by @wvffle in #1506
🚀 Features
-
all: Support reactive getter as argument - in #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 ofwatch
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- useAbs: New function - by @LittleSound and @antfu in #1825
- useCeil: New function - by @webfansplz in #1818
- useFloor: New function - by @webfansplz in #1817
- useMath: New function - by @antfu in #1935
- useMax: New function - by @FrankFang and @antfu in #1829
- useMin: New function - by @antfu in #1934
- useRound: New function - by @webfansplz in ...
v9.0.0-beta.2
🚨 Breaking Changes
🚀 Features
- syncRef: Support custom transforms - by @chaii3 and @antfu in #1968
- useArrayFindIndex: New function - by @huynl-96 in #1973
- useAsyncState: Add
throwError
option - by @TuiMao233 and @antfu in #1975 - useColorMode: New
initialValue
option - by @antfu (fcaf9) - useStorage:
mergeDefaults
option - by @webfansplz and @antfu in #1957 - useTextDirection: New function - by @iChengbo and @antfu in #1678
View changes on GitHub
v9.0.0-beta.1
🚨 Breaking Changes
- useInterval: Rename type
IntervalOptions
toUseIntervalOptions
- by @okxiaoliang4 in #1945 - useIntervalFn: Rename type
IntervalFnOptions
toUseIntervalFnOptions
- by @okxiaoliang4 in #1943 - useTimeoutFn,useTimeout: Rename type
TimeoutOptions
toUseTimeoutOptions
andTimeoutFnOptions
toUseTimeoutFnOptions
- by @okxiaoliang4 in #1944
🐞 Bug Fixes
- nuxt: Support import submodules for
@vueuse/integrations
- by @antfu (18ba0) - onClickOutside: Fix handler type - by @sibbng in #1961
- useOffsetPagination: Incorrectly
currentPageSize
value - by @webfansplz in #1949 - useSpeechSynthesis: Remove duplicated
onend
, fix demo - by @sibbng in #1941 - useWebSocket: Set initial status as
CLOSED
- by @chaii3 in #1960
View changes on GitHub
v9.0.0-beta.0
🚨 Breaking Changes
- all:
isSupported
becomesRef<boolean>
instead ofboolean
for SSR compatibility - by @okxiaoliang4 in #1800 - all: Rename function options type with consistant
Use
prefix, huge thanks to @okxiaoliang4! (this should not affect most of the usage case, unless you are importing those types directly)-
All Changes
- useSpeechSynthesis: Rename type
Status
toUseSpeechSynthesisStatus
- by @antfu (db61f) - onKeyStroke: Rename type
KeyStrokeOptions
toOnKeyStrokeOptions
- by @okxiaoliang4 in #1807 - useAsyncState: Rename type
AsyncStateOptions
toUseAsyncStateOptions
- by @okxiaoliang4 in #1809 - useClipboard: Rename type
ClipboardOptions
toUseClipboardOptions
andClipboardReturn
toUseClipboardReturn
- by @okxiaoliang4 in #1861 - useElementVisibility: Rename type
VisibilityScrollTargetOptions
toUseElementVisibilityOptions
- by @okxiaoliang4 in #1863 - useEventSource: Return type should be
UseEventSourceReturn
- by @okxiaoliang4 in #1864 - useFavicon: Rename type
FaviconOptions
toUseFaviconOptions
- by @okxiaoliang4 in #1865 - useFocusWithin: Rename type
FocusWithinReturn
toUseFocusWithinReturn
- by @okxiaoliang4 in #1866 - useGeolocation: Rename type
GeolocationOptions
toUseGeolocationOptions
- by @okxiaoliang4 in #1868 - useIdle: Rename type
IdleOptions
toUseIdleOptions
- by @okxiaoliang4 in #1869 - useIntersectionObserver: Rename type
IntersectionObserverOptions
toUseIntersectionObserverOptions
- by @okxiaoliang4 in #1870 - useJwt: Rename type
JwtOptions
toUseJwtOptions
andJwtResult
toUseJwtReturn
- by @okxiaoliang4 in #1899 - useKeyModifier: Rename type
ModifierOptions
toUseModifierOptions
- by @okxiaoliang4 in #1871 - useMagicKeys: Rename type
MagicKeys
toUseMagicKeysReturn
- by @okxiaoliang4 in #1873 - useMemoize: Rename type
UseMemoizedFn
toUseMemoizeReturn
and new typeUseMemoizeOptions
- by @okxiaoliang4 in #1872 - useMemory: Rename type
MemoryOptions
toUseMemoryOptions
- by @okxiaoliang4 in #1605 - useMouse: Rename type
MouseOptions
toUseMouseOptions
- by @okxiaoliang4 in #1877 - useMutationObserver: Rename type
MutationObserverOptions
toUseMutationObserverOptions
- by @okxiaoliang4 in #1884 - useParallax: Rename type
ParallaxOptions
toUseParallaxOptions
andParallaxReturn
toUseParallaxReturn
- by @okxiaoliang4 in #1885 - usePointerSwipe: Rename type
PointerSwipeOptions
toUsePointerSwipeOptions
andPointerSwipeReturn
toUsePointerSwipeReturn
- by @okxiaoliang4 in #1886 - useRTDB: Rename type
RTDBOptions
toUseRTDBOptions
- by @okxiaoliang4 in #1901 - useRafFn: Rename type
RafFnOptions
toUseRafFnOptions
- by @okxiaoliang4 in #1887 - useResizeObserver: Rename type
ResizeObserverOptions
toUseResizeObserverOptions
- by @okxiaoliang4 in #1862 - useShare: Rename type
ShareOptions
toUseShareOptions
- by @okxiaoliang4 in #1888 - useSpeechRecognition: Rename type
SpeechRecognitionOptions
toUseSpeechRecognitionOptions
- by @okxiaoliang4 in #1889 - useSpeechSynthesis: Rename type
SpeechSynthesisOptions
toUseSpeechSynthesisOptions
- by @okxiaoliang4 in #1890 - useSpeechSynthesis: Remove
voiceInfo
, allowvoice
as ref - by @sibbng in #1882 - useStorage: Rename type
StorageOptions
toUseStorageOptions
- by @okxiaoliang4 in #1867 - useStorageAsync: Rename type
StorageAsyncOptions
toUseStorageAsyncOptions
- by @okxiaoliang4 in #1883 - useSwipe: Rename type
SwipeOptions
toUseSwipeOptions
andSwipeReturn
toUseSwipeReturn
- by @okxiaoliang4 in #1891 - useTimestamp: Rename type
TimestampOptions
toUseTimestampOptions
- by @okxiaoliang4 in #1892 - useTransition: Rename type
TransitionOptions
toUseTransitionOptions
- by @okxiaoliang4 in #1893 - useVModel: Rename type
VModelOptions
toUseVModelOptions
- by @okxiaoliang4 in #1894 - useWebSocket: Rename type
WebSocketOptions
toUseWebSocketOptions
andWebSocketResult
toUseWebSocketReturn
- by @okxiaoliang4 in #1895 - useWebWorkerFn: Rename type
WebWorkerOptions
toUseWebWorkerOptions
- by @okxiaoliang4 in #1896 - useWindowSize: Rename type
WindowSizeOptions
toUseWindowSizeOptions
- by @okxiaoliang4 in #1897
- useSpeechSynthesis: Rename type
-
- math: Move
logicAnd
,logicOr
,logicNot
,useClamp
to@vueuse/math
- by @antfu in #1794, #1810 - reactify: Enable support for reactive getter by default - by @antfu in #1860
- useThrottleFn:
trailing
option should befalse
by default - by @webfansplz and @antfu in #1687 - useMagicKeys: Store
key
instead ofkeyCode
incurrent
- by @wvffle in #1506
🚀 Features
-
all: Support reactive getter as argument - in #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 ofwatch
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- useAbs: New function - by @LittleSound and @antfu in #1825
- useCeil: New function - by @webfansplz in #1818
- useFloor: New function - by @webfansplz in #1817
- useMath: New function - by @antfu in #1935
- useMax: New function - by @FrankFang and @antfu in #1829
- useMin: New function - by @antfu in #1934
- useRound: New function - by @webfansplz in #1820
- useSum: New function - by @holazz in #1837
- useTrunc: New function - by @hanpei and @antfu in #1838
- useAverage: New function - by @colgin and @antfu in #1826
-
New Array related utilities
v8.9.4
🐞 Bug Fixes
- useDropZone: Improve argument type - by @aki77 in #1933
- useFileDialog: Explict
UseFileDialogReturn
type - by @xiaoxiangmoe in #1927 - useInfiniteScroll: Add direction types - by @sand4rt in #1929
View changes on GitHub
v8.9.3
🐞 Bug Fixes
- useStyleTag: Fix hydration mismatch issue - by @sibbng in #1918
- useVModel: Fix compact with 2.7, fix #1745 - by @Staremang in #1898
View changes on GitHub
v8.9.2
🚀 Features
- onClickOutside: Add
detectIframe
option - by @sibbng in #1795 - useVModel: Compact with 2.7, fix #1745 - by @jiuran in #1798
🐞 Bug Fixes
- useMagicKeys: Fix setting properties of undefined value - by @Matrixbirds in #1856