echarts: __DEV__ is not defined
One-line summary [问题简述]
vue项目 webpack 引入 echarts 第一次进如没有问题 刷新就会报错500 显示__DEV__ not defined

Version & Environment [版本及环境]
- ECharts version [ECharts 版本]:3.0以上版本
- Browser version [浏览器类型和版本]:chrome Safari
- OS Version [操作系统类型和版本]: Mac 10
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
option = {
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: true},
saveAsImage: {show: true}
}
},
legend: {
data:['打印数量','扫码数量','扫码率']
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: this.xAxisdata
}
],
yAxis: [
{
type: 'value',
name: '数量',
position: 'right',
axisLine: {
lineStyle: {
color: colors[0]
}
},
axisLabel: {
// formatter: '{value} ml'
}
},
{
type: 'value',
name: '扫码率',
min: 0,
max: 100,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value} %'
}
}
],
dataZoom: [
{
type: 'slider',
show: true,
start: 1,
end: 3
}
],
series: [
{
name:'打印数量',
type:'bar',
data:this.printedata,
},
{
name:'扫码数量',
type:'bar',
data:this.scandata
},
{
name:'扫码率',
type:'line',
yAxisIndex: 1,
data:this.scanratedata
}
]
}
Other comments [其他信息]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (4 by maintainers)
我们在新发布的 3.8.2 中将 lib 下的重新转译成了 CommonJS 格式并且去掉了 DEV,应该解决了大家构建的兼容问题。非常抱歉新版本的模块系统给大家造成了这么大的麻烦。