import{useLocalStorage,useMouse,usePreferredDark}from'@vueuse/core'exportdefault{setup(){// tracks mouse positionconst{ x, y }=useMouse()// is user prefers dark themeconstisDark=usePreferredDark()// persist state in localStorageconststore=useLocalStorage('my-storage',{name: 'Apple',color: 'red',},)return{ x, y, isDark, store }},}
vueuse/vueuse
Collection of essential Vue Composition Utilities
Refer to functions list or documentations for more details.
Add ons | Nuxt Module
Demos
CDN
It will be exposed to global as
window.VueUse
See the Contributing Guide
This project is heavily inspired by the following awesome projects.
And thanks to all the contributors on GitHub!
Financial Contributors on Open Collective
MIT License © 2019-PRESENT Anthony Fu