Sfoglia il codice sorgente

wait for plotly to be loaded (fixes #3784)

Falko Schindler 8 mesi fa
parent
commit
9598efd8ae
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      nicegui/elements/plotly.vue

+ 6 - 0
nicegui/elements/plotly.vue

@@ -13,6 +13,12 @@ export default {
   },
   methods: {
     update() {
+      // wait for plotly to be loaded
+      if (typeof Plotly === "undefined") {
+        setTimeout(this.update, 10);
+        return;
+      }
+
       // default responsive to true
       const options = this.options;
       if (options.config === undefined) options.config = { responsive: true };