Vueuse Shared

Posted on  by admin

VueUse is a collection of utility functions based on Composition API. We assume you are already familiar with the basic ideas of Composition API before you continue.

Installation #

🎩 VueUse works for Vue 2 & 3 within a single package by the power of vue-demi!

Vue 3 Demo: Vite, Webpack / Vue 2 Demo: Vue CLI

From v6.0, VueUse requires vue >= v3.2 or @vue/composition-api >= v1.1

CDN #

It will be exposed to global as window.VueUse

Nuxt #

From v6.7.0, we shipped a Nuxt module to enable auto importing for Nuxt 3 and Nuxt Bridge.

And then use VueUse function anywhere in your Nuxt app. For example:

Usage Example #

Simply importing the functions you need from @vueuse/core

Refer to functions list for more details.