Skip to content

vueblocks/vue-use-utilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

15cfbd0 Β· Oct 28, 2021
May 24, 2021
Mar 10, 2021
Oct 27, 2021
Oct 28, 2021
Oct 27, 2021
Mar 10, 2021
Dec 5, 2020
Oct 27, 2021
Feb 24, 2021
Nov 30, 2020
Oct 26, 2021
Oct 27, 2021
Nov 30, 2020
Oct 27, 2021
Oct 26, 2021
Dec 5, 2020
Dec 5, 2020
Oct 26, 2021

Repository files navigation

Vue Use Utilities


NPM NPM Download support Minzipped Size lerna OpenBase License

Vue Use Utilities build on top of vue-demi & @vue/compostion-api. It works both for Vue 2 & 3.


✨ Features

  • πŸ›  Composable Utilities
  • 🌳 TreeShakable & SideEffects Free, Check out Bundle Phobia
  • πŸ’ͺ Fully Typed APIs
  • 🀟 Vue 2 and 3 Support
  • 🧩 Advanced Integration

πŸ“¦ Installation

# Vue 2 with @vue/composition-api
yarn add @vue/composition-api @vueblocks/vue-use-core -S
or
npm i @vue/composition-api @vueblocks/vue-use-core -S

# Vue 3
yarn add @vueblocks/vue-use-core -S
or
npm i @vueblocks/vue-use-core -S

πŸ¦„οΈ Demos

Vue 2 Demo: Vue CLI 2.x | Vue 3 Demo: Vue CLI 3.x

πŸ’‘ Usage

<input v-model="searchVal" />
import { useDebouncedRef } from '@vueblocks/vue-use-core'

export default {
  ...
  setup () {
    const searchVal = useDebouncedRef('', 500)

    // mock use input
    searchVal.value = 'x'
    searchVal.value = 'xi'
    searchVal.value = 'xia'
    searchVal.value = 'xiao'

    return {
      searchVal
    }
  }
  ...
}

πŸ“– Documentation

Check our documentation

🧩 Integration

The Integration part provide utilities for commonly used libraries.

Vuex

@vueblocks/vue-use-vuex - Use Vuex With Composition API Easily.

useVuex

  • useState - same as mapState
  • useGetters - same as mapGetters
  • useMutations - same as mapMutations
  • useActions - same as mapActions

useStore

  • useStore - same as Vuex 4.x composition api useStore

Read Docs

Axios

@vueblocks/vue-use-axios - Use Axios with Compositon API Easily.

  • useAxios - is a wrapper of axios

Read Docs

Thanks

πŸ“„ License

MIT @xiaoluoboding