import{useLocalStorage,useMouse,usePreferredDark}from'@vueuse/core'exportdefault{setup(){// tracks mouse positionconst{ x, y }=useMouse()// if 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
🚀 Features
🦄 Usage
Refer to functions list or documentations for more details.
📦 Install
Add ons | Nuxt Module
Demos
CDN
It will be exposed to global as
window.VueUse
🪴 Project Activity
🧱 Contribute
See the Contributing Guide
🌸 Thanks
This project is heavily inspired by the following awesome projects.
And thanks to all the contributors on GitHub!
👨🚀 Contributors
Financial Contributors on Open Collective
📄 License
MIT License © 2019-PRESENT Anthony Fu