700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > vue 引入json地图_在vue2.x中使用echarts 地图或者theme引入js 文件 会有问题 地

vue 引入json地图_在vue2.x中使用echarts 地图或者theme引入js 文件 会有问题 地

时间:2021-04-11 01:59:26

相关推荐

vue 引入json地图_在vue2.x中使用echarts 地图或者theme引入js 文件 会有问题 地

One-line summary [问题简述]

在vue2.x中使用echarts,地图或者theme引入会有问题

import echarts from 'echarts/dist/echarts';

import macaronsfrom 'echarts/theme/macarons';//shine roma macarons

//require('echarts/theme/macarons');

export default {

data () {

return {

msg: 'Hello Vue!'

}

},

mounted: function() {

this.myChart = echarts.init(document.getElementById('main'), 'macarons');

var option = {...}

this.myChart.setOption(option);

}

}

不管是map还是theme,js类型的,import之后,都没有效果

我试了map的json格式,再用echarts.registerMap,地图就可以。

import china from 'echarts/map/json/china.json';

echarts.registerMap('china', china);

我查看了chian.js里面的代码,怀疑是echarts.registerMap这边有问题。

Expected behaviour [期望结果]

希望官网提供的js格式也没有问题。

vue 引入json地图_在vue2.x中使用echarts 地图或者theme引入js 文件 会有问题 地图的json文件重新注册可以...

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。