Today encountered when writing vuex of a special silent question, to find half an hour to find the problem, so posted, it will not be in the face and I have the same problem too panic
In any case get less than $ store the first time to write vuex, then for a long time only to find that I have to the global VUE injection when the injection is not the store Store
This difference may seem a letter of no problem, but I could not get the global $ store;
Code offer
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
Import
view
from
'View'
import App
from
'./App'
import router
from
'./router'
import font
from
'./static/js/font.js';
import
'./static/scss/animate.css'
Vue.config.productionTip
=
false
import Store
from
'./store/store.js';
/* eslint-disable no-new */
new
view ({
the
:
'#app'
,
router,
Store,
components
: { App },
template
:
'<App/>'
})
I was so written before, so they can not get out, but there is no logical problem
After I replaced the uppercase S lowercase s came out
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
Import
view
from
'View'
import App
from
'./App'
import router
from
'./router'
import font
from
'./static/js/font.js';
import
'./static/scss/animate.css'
Vue.config.productionTip
=
false
import store
from
'./store/store.js';
/* eslint-disable no-new */
new
view ({
the
:
'#app'
,
router,
store,
components
: { App },
template
:
'<App/>'
})