JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 995
  • Score
    100M100P100Q109712F
  • License Apache-2.0

A util package to use Vue 2 with Composition API easily

Package Exports

  • @logue/vue2-helpers
  • @logue/vue2-helpers/vue-router
  • @logue/vue2-helpers/vuetify
  • @logue/vue2-helpers/vuex

Readme

Vue2 Helpers

jsdelivr CDN NPM Downloads Open in unpkg npm version Open in Gitpod

A util package to use Vue 2 with Composition API easily. This fork supports Vuetify2.

⬇️ Install

npm i -S @logue/vue2-helpers

or

yarn add -D @logue/vue2-helpers

📃 Usage

import { createVuexHelpers } from '@logue/vue2-helpers';
import { useRouter } from '@logue/vue2-helpers/vue-router';

const { useState } = createVuexHelpers<
    RootState, RootGetters, RootMutations, RootActions
>();
// Get a reactive and mutable ref object "stateA"
const { stateA } = useState('module', ['stateA']);

const router = useRouter();
router.push('/login');

✨ API

vue2-helpers

Features Description
createVuexHelpers<
    RootState, RootGetters, RootMutations, RootActions
>(): {
    useState, useGetters, useMutations, useActions
}
The helper methods in return value are
used to replace mapState, mapGetters,
mapMutations, mapActions

vue2-helpers/vuex

Features Description
createStore<S>(options: StoreOptions<S>): Store<S>
useStore<S = any>(): Store<S>

vue2-helpers/vue-router

Features Description
createRouter(options: RouterOptions): Router
onBeforeRouteLeave(leaveGuard: NavigationGuard): void
onBeforeRouteUpdate(updateGuard: NavigationGuard): void
useRoute(): RouteLocationNormalized
useRouter(): Router
router.isReady(): Promise<void>

vue2-helpers/vuetify

Features Description
useVuetify(): Framework

License

MIT

☎️ Contact

Modified by Logue.