<div class="echarts">
  <IEcharts :option="bar" ref="echarts"></IEcharts>
</div>
 
mounted () {
      this.init()
    },
    methods: {
      init () {
        const self = this
        setTimeout(() => {
          window.onresize = function () {
            self.$refs.echarts.resize()
          }
        }, 20)
      },
      handleClick (tab, event) {
        console.log()
      }
    }

需要我们手动去触发echarts中的resize()事件,当监听到浏览器窗口变化时,重新绘制canvas画布

相关文章:

  • 2021-07-20
  • 2022-02-04
  • 2022-12-23
  • 2021-06-26
  • 2021-09-08
  • 2022-03-07
  • 2021-11-21
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-30
  • 2021-06-26
  • 2021-12-07
相关资源
相似解决方案