鍍金池/ 問答/HTML/ vuex組件引用報錯

vuex組件引用報錯

我發(fā)現(xiàn)我每次引用vux組件時候都報錯

 ERROR  Failed to compile with 1 errors                                                                                                                                                                          01:23:09
 error  in ./node_modules/_vux@2.9.1@vux/src/components/v-chart/mixin.js

Module parse failed: Unexpected token (18:6)
You may need an appropriate loader to handle this file type.
|     this.$parent.set(this.chartName, {
|       shape: defaultShapeMap[this.chartName] || '',
|       ...this.$props,
|       ...camelAttrs(this.$attrs)
|     })

 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/_vux@2.9.1@vux/src/components/v-chart/v-line.vue 2:0-27
 @ ./node_modules/_vux@2.9.1@vux/src/components/v-chart/v-line.vue
 @ ./node_modules/_vux@2.9.1@vux/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

main.js如下:

// 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 Vue from 'vue'
import App from './App'
import router from './router'
import MetaInfo from 'vue-meta-info'
import { Icon } from 'vux'

Vue.config.productionTip = false
Vue.use(MetaInfo)
Vue.component('icon', Icon)


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

不知道這到底是什么原因?
是不是vux的引入方式不正確導(dǎo)致?

回答
編輯回答
淺淺

先把題目改改大哥,vux不能直接這么用,看看文檔
https://doc.vux.li/zh-CN/inst...
vux2必須配合vux-loader使用, 請在build/webpack.base.conf.js里參照如下代碼進(jìn)行配置:

2017年9月16日 01:39