出错内容
Cannot read property 'get' of undefined"
app.js
require('./bootstrap');
window.Vue = require('vue');
import VueRouter from 'vue-router';
import router from './routes';
import Vuex from 'vuex';
import App from './components/App';
Vue.use(VueRouter);
Vue.use(Vuex);
Vue.component('app', App);
const store = new Vuex.Store({
state: {
settings: []
},
mutations: {
set_settings(state, data) {
state.settings = data;
}
},
actions: {
getSettings(store) {
console.log(1111);
Vue.axios.get('/api/setting/index').then(response => {
store.commit('set_settings', response.data.settings);
})
}
}
});
Vue.axios.get 这个出错了吧