发布时间:2022-11-18 文章分类:编程知识 投稿人:李佳 字号: 默认 | | 超大 打印
<el-dialog
   lock-scroll
   width="80%"
  
   @opened="opens">
   <div>
       <div ref="chart1"></div>
       <div ref="chart2"></div>
   </div>
</el-dialog>
methods:{
    initChart1() {
         this.chart1 = this.$echarts.init(this.$refs.chart1)
         this.chart1.setOption(this.chart1option)
     },
     initChart2() {
         this.chart2 = this.$echarts.init(this.$refs.chart2)
         this.chart2.setOption(this.chart2option)
     },
     // 进行echarts的初始化,执行数据
     opens(){
         this.$nextTick(() => {
            this.initChart1()
            this.initChart2()
         })
     }