GithubHelp home page GithubHelp logo

Comments (1)

yyx990803 avatar yyx990803 commented on July 24, 2024 1

You didn't call Vue.use(Vuex)
On Sat, Mar 5, 2016 at 4:41 AM rickimoore [email protected] wrote:

After fresh npm and vuex installs while using browserify, creating new
Vue.store continuely throws calendar_component.js:10205Uncaught TypeError:
Cannot read property 'config' of undefined.

Opening up the error reveals this code:

`function Store() {
var _this = this;

var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

var _ref$state = _ref.state;
var state = _ref$state === undefined ? {} : _ref$state;
var _ref$mutations = _ref.mutations;
var mutations = _ref$mutations === undefined ? {} : _ref$mutations;
var _ref$modules = _ref.modules;
var modules = _ref$modules === undefined ? {} : _ref$modules;
var _ref$middlewares = _ref.middlewares;
var middlewares = _ref$middlewares === undefined ? [] : _ref$middlewares;
var _ref$strict = _ref.strict;
var strict = _ref$strict === undefined ? false : _ref$strict;
babelHelpers.classCallCheck(this, Store);

this._dispatching = false;
this._rootMutations = this._mutations = mutations;
this._modules = modules;
// bind dispatch to self
var dispatch = this.dispatch;
this.dispatch = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

dispatch.apply(_this, args);

};
// use a Vue instance to store the state tree
// suppress warnings just in case the user has added
// some funky global mixins
var silent = Vue.config.silent;
Vue.config.silent = true;
this._vm = new Vue({
data: state
});
Vue.config.silent = silent; ---------------> this is the line of the error here
this._setupModuleState(state, modules);
this._setupModuleMutations(modules);
this._setupMiddlewares(middlewares, state);
// add extra warnings in strict mode
if (strict) {
this._setupMutationCheck();
}
}

`

I have no idea why this is happening, i tried to reinstall both but
continue with this error. Here is my root vue instance where i am trying to
start the vuex store.

`
// browserify entrypoint

var Vue = require('vue');
import Vuex from 'vuex';

import calendarHeader from './components/Header.vue';
import calendarSettings from './components/Settings.vue';
import calendarContent from './components/Contents.vue';

const state = {
count: 0
}

const mutations = {
INCREMENT (state) {
state.count++
}
}

const store = new Vuex.Store({
state,
mutations
});

new Vue({

store,

el: '#calendar',

components: { calendarHeader, calendarSettings, calendarContent},

ready: function() {

console.log('Ready too go!');
console.log(store.state.count) // -> 1

},

methods: {

parallax: function() {

    var velocity = 0.4;
    var pos = $('#calendar').scrollTop();
    var scr = Math.round((0 - pos) * velocity);

    $('.current_day_header .header_window').css('backgroundPosition', '0 ' + scr +  'px');

        if(scr < -200){
            scr = -200;
        }
}

}

});

`

How do i resolve this error? so fare i removed everything and narrowed it
down to this line

const store = new Vuex.Store({

Can someone help me?


Reply to this email directly or view it on GitHub
#79.

from vuex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.