按需 引入 echart

1. utils 

// echarts 配置

// 引入 ECharts 模块
const echarts = require('echarts/lib/echarts')

//引入图表组件
require('echarts/lib/chart/bar')
require("echarts/lib/chart/line")
require("echarts/lib/chart/pie")
require("echarts/lib/chart/radar")

//引入提示框,标题等组件
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
require("echarts/lib/component/legend")
require("echarts/lib/component/graphic")
export default echarts

2.使用 

  import echarts from '@/utils/echarts'

 

posted @ 2020-12-11 17:49  1点  阅读(636)  评论(0编辑  收藏  举报