未捕获的SyntaxError:使用vuex时出现无效或意外的令牌

时间:2017-05-25 20:48:03

标签: javascript vue.js vuejs2 vue-component vuex

这是我的商店文件

const store = new Vuex.Store({
state: {
    pokemons: []
},
actions: {
    LOAD_POKEMON_LIST: function() {
        axios.get('http://pokeapi.co/api/v2/pokemon/').then((response) => {
            console.log(response.data)
        }, (err) => {
            console.log(err)
        })
    }
}
});

export default store

编译文件时,浏览器会抛出此错误

Uncaught SyntaxError: Invalid or unexpected token

0 个答案:

没有答案