MyGit

vueuse/vueuse

Fork: 2531 Star: 20047 (更新于 2024-11-06 10:50:42)

license: MIT

Language: TypeScript .

Collection of essential Vue Composition Utilities for Vue 2 and 3

最后发布版本: v11.1.0 ( 2024-09-16 17:09:03)

官方网址 GitHub网址

VueUse - Collection of essential Vue Composition Utilities VueUse - Collection of essential Vue Composition Utilities
Collection of essential Vue Composition Utilities

NPM version NPM Downloads Docs & Demos Function Count
GitHub stars

🚀 Features

  • 🎪 Interactive docs & demos
  • 🕶 Seamless migration: Works for both Vue 3 and 2
  • Fully tree shakeable: Only take what you want, bundle size
  • 🦾 Type Strong: Written in TypeScript, with TS Docs
  • 🔋 SSR Friendly
  • 🌎 No bundler required: Usable via CDN
  • 🔩 Flexible: Configurable event filters and targets
  • 🔌 Optional Add-ons: Router, Firebase, RxJS, etc.

🦄 Usage

import { useLocalStorage, useMouse, usePreferredDark } from '@vueuse/core'

export default {
  setup() {
    // tracks mouse position
    const { x, y } = useMouse()

    // if user prefers dark theme
    const isDark = usePreferredDark()

    // persist state in localStorage
    const store = useLocalStorage(
      'my-storage',
      {
        name: 'Apple',
        color: 'red',
      },
    )

    return { x, y, isDark, store }
  },
}

Refer to functions list or documentations for more details.

📦 Install

🎩 From v4.0, it works for Vue 2 & 3 within a single package by the power of vue-demi!

npm i @vueuse/core

Add ons | Nuxt Module

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

Demos

CDN

<script src="https://unpkg.com/@vueuse/shared"></script>

<script src="https://unpkg.com/@vueuse/core"></script>

It will be exposed to global as window.VueUse

🪴 Project Activity

Alt

🧱 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

最近版本更新:(数据更新于 2024-10-15 22:09:13)

2024-09-16 17:09:03 v11.1.0

2024-08-25 01:31:30 v11.0.3

2024-08-19 18:10:28 v11.0.1

2024-08-16 04:17:28 v11.0.0

2024-08-15 02:16:11 v11.0.0-beta.3

2024-08-08 23:49:09 v10.11.1

2024-07-17 22:30:15 v11.0.0-beta.2

2024-06-13 06:21:20 v11.0.0-beta.1

2024-06-12 19:49:23 v10.11.0

2024-06-11 21:33:18 v10.10.1

主题(topics):

composable, utility-library, vue, vue-composition-api, vue-next, vue-use, vue3

vueuse/vueuse同语言 TypeScript最近更新仓库

2024-11-24 06:05:47 RSSNext/Follow

2024-11-23 21:18:28 MetaCubeX/metacubexd

2024-11-23 12:44:19 clash-verge-rev/clash-verge-rev

2024-11-23 10:05:04 continuedev/continue

2024-11-23 02:27:31 microsoft/TypeScript

2024-11-23 00:25:37 siyuan-note/siyuan