echart.js所谓的AMD模块加载真心搞不懂,用require.js加载不了。求高手解答。
怪我咯2017-04-10 15:09:54
http://echarts.baidu.com/doc/doc.html#引入ECharts1
http://692088846.iteye.com/blog/1997128
迷茫2017-04-10 15:09:54
可以把echarts当做一个package
js
require.config({ baseUrl: '/j/pj/', packages: [ { name: 'echarts', location: 'vendor/echarts', main: 'echarts' }, { name: 'zrender', location: 'vendor/zrender', // zrender与echarts在同一级目录 main: 'zrender' } ] }) //在文件中使用 define(['echarts', 'echarts/chart/bar'], function(ec) {})