Vuejs使用Echarts

在VueJS当中使用Echarts

安装Echars

npm install Echarts --save

vuejs当中的main.js文件

// 引入echars
import echarts from 'echarts'
// 添加echarts插件
Vue.prototype.$echarts = echarts

prototype 属性使您有能力向对象添加属性和方法。

vuejs当中的hello.vue(cli创建就有这个文件哦)

其实这里hello.vue指代的是组件,你可以使用任意组件。




效果

Vuejs使用Echarts_第1张图片
效果

你可能感兴趣的:(Vuejs使用Echarts)