Ver código fonte

remove unnecessary timeout

Falko Schindler 1 ano atrás
pai
commit
0ce9cd811c
1 arquivos alterados com 3 adições e 5 exclusões
  1. 3 5
      nicegui/elements/echart.js

+ 3 - 5
nicegui/elements/echart.js

@@ -1,11 +1,9 @@
 export default {
   template: "<div></div>",
   mounted() {
-    setTimeout(() => {
-      this.chart = echarts.init(this.$el);
-      this.chart.setOption(this.options);
-      this.chart.resize();
-    }, 0); // NOTE: wait for window.path_prefix to be set in app.mounted()
+    this.chart = echarts.init(this.$el);
+    this.chart.setOption(this.options);
+    this.chart.resize();
   },
   beforeDestroy() {
     this.destroyChart();