my main.js goes like this:
import Vue from "vue"
import Vuex from "vuex";
import App from "./App"
import router from "./router"
//import store from "./store/vuexstore.js"//vuexstore.js
Vue.config.productionTip = false
/*****/
Vue.use(Vuex)
let state={
cartData:[]
};
let mutations = {
updateCartData(state, _cartData){
state.cartData = _cartData;
}
}
var store=new Vuex.Store({
state,
mutations
})
/*****/
new Vue({
el: "-sharpapp",
router,
store,//store
components: { App },
template: "<App/>"
})
console.log( store);// Vuex.Store
console.log( this.$store,Vue.$store);//2undefined
console.log( vue.prtotype);//vue$route$store
you can also see the vuex project in Google"s vue debugging plug-in, but calling this.$store in the code can"t solve ~
Thank you in advance! ~