vue集合添加集合

虚假 (vueuse)

Collection of essential Vue Composition API (inspired by react-use)

收集基本的Vue Composition API(受React使用启发)

Please [register the Composition API Plugin](https://github.com/vuejs/composition-api#usage) before other using APIs.

### CDN

```html
<!-- For Vue 3.x -->
<script src="https://unpkg.com/@vueuse/[email protected]"></script> 

<!-- For Vue 2.x -->
<script src="https://unpkg.com/@vueuse/core"></script>

It will be exposed to global variable window.VueUse

它将显示在全局变量window.VueUse

⚡功能 (⚡ Functions)

You can checkout the documents and live demos in Storybook.

您可以在Storybook中签出文档和现场演示。

  • useCounter

    useCounter

  • useIntervalFn

    useIntervalFn

  • useStorage

    useStorage

  • useStoragePlain

    useStoragePlain

  • useNow

    现在使用

  • useRaf

    useRaf

  • useTimeout

    useTimeout

  • useTimeoutFn

    useTimeoutFn

  • useWindowScroll

    useWindowScroll

  • useWindowSize

    useWindowSize

More functions to be added. Please keep turned. (PRs are also welcome!)

要添加更多功能。 请保持转弯。 (也欢迎PR!)

🔬技术细节 (🔬 Technical Details)

版本控制 (The Versioning)

For every release, it will release two version of this package. The 3.x.x is used for Vue 3.x and the 2.x.x is used for 2.x. We use the major version number to distinguish the different target version will the minor and patch numbers are shared in both packages.

对于每个发行版,它将发行此软件包的两个版本。 3.xx用于Vue 3.x,而2.xx用于2.x。 我们使用主要版本号来区分将在两个软件包中共享次要号和补丁号的不同目标版本。

3.x和2.x之间的区别 (Different between 3.x and 2.x)

Since the Composition API will be available in 3.x. Using it in 2.x require you use a polyfill. For 3.x build, we use the API from @vue/runtime-dom, and for 2.x, it's @vue/composition-api

由于Composition API将在3.x中可用。 在2.x中使用它要求您使用polyfill。 对于3.x构建,我们使用@vue/runtime-dom的API,对于2.x,它是@vue/composition-api

// 3.x build
import { ref } from '@vue/runtime-dom'

// 2.x build
import { ref } from '@vue/composition-api'

翻译自: https://vuejsexamples.com/collection-of-essential-vue-composition-api/

vue集合添加集合

Logo

前往低代码交流专区

更多推荐