引入vux报错

2018-10-26  本文已影响0人  蜻蜓路过风

出错提示:

ERROR Failed to compile with 1 errors 18:17:42

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)
| })

解决办法

vux官方文档提示


vux官方文档解决方案.png

即在末尾添加:

const vuxLoader = require('vux-loader')
const webpackConfig = module.exports 

module.exports = vuxLoader.merge(webpackConfig, {
  plugins: ['vux-ui']
})

(记得安装vux-loader

上一篇下一篇

猜你喜欢

热点阅读