首页 > 其他 > 详细

echarts 踩坑 : 为什么效果出不来?看看有没有正确引入

时间:2019-11-24 19:49:58      阅读:342      评论:0      收藏:0      [点我收藏+]

今天我要给 echarts 组件加个 dataZoom 功能,结果发现没有效果。

后来发现是引入 echarts 模块的问题。

如果是按需引入的话,必须引入相应的功能模块才能使用相应的功能。

举例:

 

import echarts from ‘echarts/lib/echarts‘
import ‘echarts/lib/chart/bar‘
import ‘echarts/lib/component/tooltip‘
import ‘echarts/lib/component/legend‘
import ‘echarts/lib/component/title‘

我没有引入 dataZoom ,所以不能使用。

 

import echarts from ‘echarts/lib/echarts‘
import ‘echarts/lib/chart/bar‘
import ‘echarts/lib/component/tooltip‘
import ‘echarts/lib/component/legend‘
import ‘echarts/lib/component/title‘
import ‘echarts/lib/component/dataZoom‘

 

这样就可以了。

echarts 踩坑 : 为什么效果出不来?看看有没有正确引入

原文:https://www.cnblogs.com/foxcharon/p/11923509.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!