报错信息:
ERROR in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./app/components/header.vue
Module build failed: SyntaxError: F:/web/tabs/app/components/header.vue: Unexpected token (32:7)
原因:
解决:
npm isntall --save-dev babel-preset-stage-3
修改.babelrc配置
{ "presets": ["es2015", "stage-3"] }
代码中
import {mapGetters} from 'vuex' export default { data(){ return { } }, computed:{ ...mapGetters([ 'isMain' ]) }, methods:{ } }