vue中的cdn方式引用echarts并使用

1.先在index.html里引用echarts


2.我会新建一个js保存图表数据,


3.在需要使用echarts的页面的 mounted里这样写


注意,不能写在created里面,因为dom元素还未挂载,getElement 会找不到,会报个错 大概是 get Attribute undefined之类的。

你可能感兴趣的:(vue中的cdn方式引用echarts并使用)