Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-use-vuex

hezedu1040.2.2

Fixed: must call Vue.use(Vuex) before creating a store instance.

vue, vuex, use, must call

readme

vue-use-vuex

Fixed: must call Vue.use(Vuex) before creating a store instance.

If you normally use vuex, just like this:

// Entry
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import 'some-store.js';

You Will get an Error:
image
WTF!

let's use vue-use-vuex to fixed it.

Install

npm install vue-use-vuex

Example

// Entry
import Vue from 'vue';
import 'vue-use-vuex'; // Just should import once
import 'some-store.js';

// no problem!

webpack-1

If you used webpack 1.x, you should used loader's include:

var vueUseVuexPath = require.resolve('vue-use-vuex');

// ...
    {
      test: /\.js$/,
      include: [path.join(__dirname, "src"), vueUseVuexPath],
      loader: 'babel-loader'
    }