<div
ref="chart"
/>
</div>
chart: null,
mounted() {
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize();
}
}, 100);
window.addEventListener("resize", this.__resizeHandler);
},
beforeDestroy() {
if (!this.chart) {
return;
}
window.removeEventListener("resize", this.__resizeHandler);
this.chart.dispose();
this.chart = null;
},
echarts 适应屏幕 vue2
最新推荐文章于 2024-11-12 11:19:19 发布