vue项目报错合集

文章目录

    • "export 'default' (imported as 'echarts') was not found in 'echarts' //echarts5报错
    • "this.$el.querySelectorAll is not a function" //element el-table 报错

"export ‘default’ (imported as ‘echarts’) was not found in ‘echarts’ //echarts5报错

错误原因:

//引入方式不对
import echarts from 'echarts

解决方案:

//将引入方式改为:
import * as echarts from 'echarts';
//或者
const echarts = require('echarts');

“this.$el.querySelectorAll is not a function” //element el-table 报错

错误原因:

//:data 是数组而我定义成了对象

projectData: {},

解决方案:

//将:data的值定位为数组

projectData: [],

你可能感兴趣的:(vue项目报错,vue.js)