Skip to content
Transport data between component and vuex in whole project. Only for Vue 1.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist + Update. Feb 20, 2017
src + Update. Feb 8, 2017
.babelrc
.editorconfig
.eslintignore
.eslintrc.js + First commit. Jan 18, 2017
.gitignore
README.md
build.js + Update. Feb 20, 2017
package.json

README.md

Vuexer

Add a new properity $vuexer in your components.

It is useful when your npm vue components are designed to use vuex and are used in different projects.

Only for Vue 1.0, because "Vue 2.0 + Vuex 2.0" has solved this problem.

Quick Start.

Use vuexer firstly.

import Vue from 'vue'
import Vuexer from 'vuexer'

import store from './vuex/store'
import actions from './vuex/actions'
import getters from './vuex/getters'

// Initialization.
Vue.use(Vuexer, {
  store,
  actions,
  getters
})

When vuexer is initialized, a new properity called $vuexer will be added to your components.

Let's see:

<script>
  export default {
    methods: {
      setCurrency (num) {
        this.$vuexer.setCurrency(num)  // "setCurrency" is the method that you defined in your vuex actions.
      }
    }
  }
</script>

<template>
  <!-- "getCurrency" is the getter that you have defined in your vuex getters. -->
  <p>currency: {{$vuexer.getCurrency}}</p>
  <div>
    <button @click="setCurrency(10)">I need $10!</button>
    <!-- Or you can also: -->
    <button @click="$vuexer.setCurrency(100)">$100 is required!</button>
  </div>
</template>

License

MIT.

You can’t perform that action at this time.