避坑06_Vue引入echarts 5.0报错export ‘default‘(imported as ‘echarts‘)was not found in ‘echarts‘

一、问题

引入 echars 5.0 遇到报错 "export ‘default’ (imported as ‘echarts’) was not found in ‘echarts’
避坑06_Vue引入echarts 5.0报错export ‘default‘(imported as ‘echarts‘)was not found in ‘echarts‘_第1张图片

二、原因及解决方法

原因
echarts 5.0新版本导致的

解决
引入方式改为

import * as echarts from 'echarts';
// 或
const echarts = require('echarts');

你可能感兴趣的:(走过的坑,echarts)