How does echars load into a line chart on demand in vue?

A simple line chart is used in the

project,

I intend to implement it in echars. After the introduction, the project size has reached more than 3m. In order to reduce the project size, I intend to load the line chart on demand

import echarts from "echarts";

let chart = null;
function initChart(canvas, width, height) {
  chart = echarts.init(canvas, null, {
    width: width,
    height: height
  });
  canvas.setChart(chart);

  var option = {
    title: {
      text: this.title,
      textStyle: {
        fontSize: "15"
      },
      subtext: this.subtext
    },
    //...

how does echars load on demand in vue?

May.24,2021

import ECharts from "vue-echarts/components/ECharts.vue";
import "echarts/lib/chart/line";
import "echarts/lib/component/title.js";
Menu