引入vux报错

出错提示:

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 14,482评论 2 59
  • 关于Mongodb的全面总结 MongoDB的内部构造《MongoDB The Definitive Guide》...
    中v中阅读 32,130评论 2 89
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,704评论 25 709
  • 我就说说我的遭遇,自己家两年前买了一个大品牌的电视,然后买到家不到一年的时间问题连连,不停地维修;咱也不是不讲理的...
    caiji6445阅读 4,692评论 5 0
  • 前言: 有很多公司利用友盟来统计错误崩溃日志,方便开发人员查找错误的位置,但是反馈的日志是无法确定到底是哪里发生崩...
    Mr_Bob_阅读 11,282评论 10 16